我开始学习 RavenDB。我在服务器机器上安装了服务器版本,并将客户端 dll 添加到一个简单的控制台应用程序中。当我尝试运行应用程序时,它给了我一个 WebException:“请求被中止:请求被取消。”
这是代码:
public class Article : AbstractIndexCreationTask<Article>
{
public string Id { get; set; }
public string Text { get; set; }
public string Title { get; set; }
public Article()
{
Map = articles => from article in articles select new { article.Text };
}
}
static void Main(string[] args)
{
var ravenIntroArticle = new Article()
{
Text = "RavenDB fits into a movement that is called ...",
Title = "RavenDB Introduction",
};
var csharpUsingArticle = new Article()
{
Text = "The full value of the C# using statement ...",
Title = "Your Friend the C# Using Statement",
};
var nutsAndProteinArticle = new Article()
{
Text = "Nuts are a great source of protein ...",
Title = "Nuts and Protein",
};
using (IDocumentStore documentStore = new DocumentStore() { Url = "http://rtest01:8081" })
{
documentStore.Initialize();
using (IDocumentSession session = documentStore.OpenSession())
{
session.Store(ravenIntroArticle); // the exception happens here
session.Store(csharpUsingArticle);
session.Store(nutsAndProteinArticle);
session.SaveChanges();
}
}
这是我尝试在本地服务器“ http://localhost:8080 ”上运行它时发生的情况
你能告诉我我错过了什么吗?
谢谢。