我正嘗試將一個Web應用程序發佈到Azure中。它發佈成功,但遇到頁面時出現運行時錯誤。在發佈到Azure時註冊ApplicationInsights WebRequestTrackingModuleRegister時出錯
這裏是堆棧跟蹤:
[ArgumentNullException: Value cannot be null.
Parameter name: moduleType]
System.Web.DynamicModuleRegistry.Add(Type moduleType) +304
System.Web.HttpApplication.RegisterModule(Type moduleType) +65
Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule(Type moduleType) +36
Microsoft.ApplicationInsights.Extensibility.AzureWebSites.WebRequestTrackingModuleRegister.Register() +38
[InvalidOperationException: The pre-application start initialization method Register on type Microsoft.ApplicationInsights.Extensibility.AzureWebSites.WebRequestTrackingModuleRegister threw an exception with the following error message: Value cannot be null.
Parameter name: moduleType.]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +586
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +129
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +163
System.Web.Compilation.BuildManager.ExecutePreAppStart() +156
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +621
[HttpException (0x80004005): The pre-application start initialization method Register on type Microsoft.ApplicationInsights.Extensibility.AzureWebSites.WebRequestTrackingModuleRegister threw an exception with the following error message: Value cannot be null.
Parameter name: moduleType.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +660
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +96
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +189
我不知道是什麼原因這一點。我只是爲App Insights for Web Applications添加nuget包,然後更新項目中包含的AppInsights.config文件中的InstrumentationKey。這些步驟與之前使用的步驟相同,但這次會產生這種奇怪的結果!
以前有人遇到過這個嗎?