问题
As the title says. (Cross post from the mailing list: https://groups.google.com/forum/#!topic/ravendb/hxP3REWVMdg)
The iisexpress process is running as the currently logged in user, but I'm only getting Unauthorized error messages when trying to create databases.
Accessing /debug/user-info only gives the following message: {"Remark":"Using anonymous user","AnonymousAreAdmins":false}
回答1:
Courtesy of Fitzchak Yitzchaki, I got the answer on the RavenDB mailing list:
https://groups.google.com/forum/?fromgroups=#!topic/ravendb/hxP3REWVMdg
The correct way of doing it was to set the AnonymousAccess
setting in web.config to Admin
:
<add key="Raven/AnonymousAccess" value="Admin"/>
The AnonymousAccess
setting is not well documented, but it tells RavenDB how to treat anonymous users. In this instance, it treats all as admin and should therefore only be used in development. For production, it should be reset to the default value which is All
.
回答2:
Try this.
var store = new EmbeddableDocumentStore
{
Configuration = { Port = 8081 },
DataDirectory = "~\\App_Data\\Raven",
UseEmbeddedHttpServer = true
};
store.Initialize();
Using "App_Data" will probably make it work for you.
来源:https://stackoverflow.com/questions/15876983/unable-to-create-databases-when-running-ravendb-on-iisexpress