我開始學習RavenDB。我在服務器機器上安裝了Server版本,並將Client dll添加到簡單的控制檯應用程序中。當我試圖運行應用程序時,它給了我一個WebException:「請求被中止:請求被取消。」RavenDB session.Store例外
下面是代碼:
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」
你能告訴發生了什麼我錯過了什麼?
謝謝。
我們需要一些更多的信息,如:服務器是否在IIS中運行?如果情況如此,那麼您可能需要調整保留,並將其從「獲取」變爲raven.server.config中的「全部」。 – VoidMain 2012-07-20 18:57:32
請在我編輯的帖子中看到圖片。 – 2012-07-20 19:47:29
機器之間是否有防火牆?什麼是安全設置?當你在一臺機器上運行它時會發生什麼? – 2012-07-21 09:10:17