获得常规ConfigurationErrorsException

时间:2015-02-03 10:47:58

标签: c# azure visual-studio-2013 stackexchange.redis azure-redis-cache

我正在使用Stackexchange redis作为我的MVC应用程序,我正在获得常规的w3wp异常,如下所示。它不会在生产中发生,所以我想知道它是否与Visual Studio有关?

使用: Visual Studio Premium 2013 版本:12.0.31101.00更新4

我正在使用Microsoft提供的ASP.NET session state provider,而在我的web.config中就是这样:(我指的是天蓝色的redis)

<system.web>
  <sessionState mode="Custom" customProvider="MySessionStateStore">
      <providers>
        <add name="MySessionStateStore" 
             type="Microsoft.Web.Redis.RedisSessionStateProvider" 
             host="***" 
             accessKey="***" 
             ssl="true"  /> 

      </providers>
  </sessionState>
</system.web>

当应用程序打开时,我每隔几分钟就会收到此异常。

Application: w3wp.exe Framework Version: v4.0.30319 Description: The process was     terminated due to an unhandled exception. 
Exception Info: System.Configuration.ConfigurationErrorsException 

Stack: at System.Diagnostics.TraceUtils.GetRuntimeObject(System.String, System.Type, System.String) 
at System.Diagnostics.TypedElement.BaseGetRuntimeObject() 
at System.Diagnostics.ListenerElement.GetRuntimeObject() 
at System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() 
at System.Diagnostics.TraceInternal.get_Listeners() 
at System.Diagnostics.TraceInternal.WriteLine(System.Object) 
at StackExchange.Redis.SocketManager.Read() 
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,  System.Threading.ContextCallback, System.Object) 
at System.Threading.ThreadHelper.ThreadStart(System.Object) 

1 个答案:

答案 0 :(得分:0)

从异常看起来它不是来自会话状态提供者。问题是由于其他原因造成的。如果异常是由RedisSessionStateProvider引起的,那么你会在Microsoft.Web.Redis.RedisSessionStateProvider *****&#34;上看到类似&#34;的内容。例外。

您可以使用不同的会话状态来验证这一点。就像尝试使用&#34; InProc&#34;会话状态提供程序,如果它仍然重现,则表示存在其他问题,而不是RedisSessionStateProvider。

如果您可以提供可以重现此问题的示例测试应用程序并通过AzureCache@microsoft.com发送给我们,那么我可以进一步调试它。

相关问题