I'm recently getting a strange error while deploying my Azure application in a new Server. I'm using ASP Providers (supplied by microsoft 开发者_StackOverflowwith Azure SDK code samples). Regardless of several uploads i'm getting this big ugly message. Please help!
Error in '/' Application. --------------------------------------------------------------------------------
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.
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: [NullReferenceException: Object reference not set to an instance of an object.]
Microsoft.Samples.ServiceHosting.AspProviders.<>c__DisplayClass5.<ResetItemTimeout>b__4() in C:\Users\upload.user\Desktop\Deployments\Deployment 2.20_A\AspProviders\TableStorageSessionStateProvider.cs:497
Microsoft.Samples.ServiceHosting.AspProviders.ProviderRetryPolicies.RetryNImpl(Action action, Int32 numberOfRetries, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff) in C:\Users\upload.user\Desktop\Deployments\Deployment 2.20_A\AspProviders\SecUtil.cs:439
Microsoft.Samples.ServiceHosting.AspProviders.<>c__DisplayClass1.<RetryN>b__0(Action action) in C:\Users\upload.user\Desktop\Deployments\Deployment 2.20_A\AspProviders\SecUtil.cs:395
System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +739 System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +114 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +370
-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Yes AppFabric Cache is officially released and supported by microsoft. THis link is of great help for tutorial: http://msdn.microsoft.com/en-us/gg457897 However, there's an additional billing aspect to using this approach whereas Tablestoragesessionprovider uses BlobStorage which is peanuts.
The advantage with these samples is that the code is provided so you can generally get a closer look at what's going wrong. I've taken a look and the most likely reason for you getting this error is that there is an error in the configuration of the session state provider (it might be pointing at the wrong account) or the table and container don't exist at that account.
There's a chance that there is just no session object available, but I find that unlikely.
Having said that, the Table Storage Session provider is not suitable for releasing in a production environment. You're much better off either using the SQL Server session provider or the App Fabric cache session provider.
精彩评论