Unable to create databases when running RavenDB on IISExpress

随声附和 提交于 2019-12-25 12:55:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!