5

RavenDBの埋め込みインスタンスを含むMVC4サイトを新しいAzureWebサイトのプレビュー機能にデプロイしようとすると、アクセスが拒否されたというメッセージが表示されます。このサイトはローカルで正常に機能しています。

Ravenの設定方法は次のとおりです。

//Initialize the RavenDB Data Store
        Raven.Database.Server.NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(8887);

        var documentStore = new EmbeddableDocumentStore()
        {
            DataDirectory = "~\\App_Data",
            UseEmbeddedHttpServer = true, 
            Configuration = { Port = 8887 }
        };

        documentStore.Initialize();

そして、これが私がサイトを閲覧したときのスタックトレースです:

Access is denied

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Net.NetworkInformation.NetworkInformationException: Access is denied

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[NetworkInformationException (0x5): Access is denied]
   System.Net.NetworkInformation.SystemIPGlobalProperties.GetAllTcpConnections() +1570717
   System.Net.NetworkInformation.SystemIPGlobalProperties.GetActiveTcpListeners() +74
   Raven.Database.Util.PortUtil.FindPort() in c:\Builds\RavenDB-Unstable-v1.2\Raven.Database\Util\PortUtil.cs:110
   Raven.Database.Util.PortUtil.GetPort(String portStr) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Database\Util\PortUtil.cs:44
   Raven.Database.Config.InMemoryRavenConfiguration.Initialize() in c:\Builds\RavenDB-Unstable-v1.2\Raven.Database\Config\InMemoryRavenConfiguration.cs:170
   Raven.Database.Config.RavenConfiguration.LoadConfigurationAndInitialize(IEnumerable`1 values) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Database\Config\RavenConfiguration.cs:28
   Raven.Database.Config.RavenConfiguration..ctor() in c:\Builds\RavenDB-Unstable-v1.2\Raven.Database\Config\RavenConfiguration.cs:17
   Raven.Client.Embedded.EmbeddableDocumentStore.get_Configuration() in c:\Builds\RavenDB-Unstable-v1.2\Raven.Client.Embedded\EmbeddableDocumentStore.cs:63
   Raven.Client.Embedded.EmbeddableDocumentStore.set_DataDirectory(String value) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Client.Embedded\EmbeddableDocumentStore.cs:90
   Solarity.DesignSearch.Website.Bootstrapper.BuildUnityContainer() in c:\a\src\Solarity.DesignSearch\Solarity.DesignSearch.Website\Bootstrapper.cs:35
   Solarity.DesignSearch.Website.Bootstrapper.Initialise() in c:\a\src\Solarity.DesignSearch\Solarity.DesignSearch.Website\Bootstrapper.cs:20
   Solarity.DesignSearch.Website.MvcApplication.Application_Start() in c:\a\src\Solarity.DesignSearch\Solarity.DesignSearch.Website\Global.asax.cs:23

[HttpException (0x80004005): Access is denied]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9859725
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Access is denied]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873912
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
4

2 に答える 2

3

理想的ではありませんが、なんとか機能させることができました。私の元の投稿で、UseEmbeddedHttpServer=trueを設定していることに気付くかもしれません。これは、http:[MyUrl]:8081を参照し、RavendDB Management Studioを取得して、データを参照できるようにするためです。何らかの理由で、RavenDBは、このプロパティが設定されている場合、ポート設定を自動(Port = *)に設定した場合と同じ種類のポートチェックを実行したいと考えています。

RavenDBは、UseEmbeddedHttpServerがTrueの場合にポート設定を尊重し、作成時にEmbeddedDocumentStoreのConfigurationプロパティを設定できるようにするための修正が必要になる可能性があると思います。

ただし、それまでの間は、ポートを指定するだけで、MVC4サイトをAzureWebサイトのEmbeddedDocumentStoreと連携させることができます。また、作成時にEmbeddedDocumentStoreのConfigurationプロパティを設定するのではなく、実際にAppSettings構成を使用する必要があります(上記で試みたように)。この投稿(stackoverflow.com/questions/11529159/)はそれを行う方法を示しています。

残念ながら、EmbeddedHttpServerを実行する方法がまだ見つからないため、RavenManagementStudioを使用できます。方法がわかれば、ここに解決策を投稿します。

于 2012-10-24T15:11:35.440 に答える
0

こんにちはこれはAzureWebサイトのRavenDbで回答されました-アクセスが拒否されました 基本的に、Web.configでポートを構成する必要があります

于 2012-10-24T01:58:10.010 に答える