ASP提供程序项目在Azure环境中失败

时间:2011-04-28 16:38:12

标签: session azure azure-storage azure-table-storage

我最近在新服务器中部署Azure应用程序时遇到了一个奇怪的错误。我正在使用ASP提供程序(由Microsoft提供的Azure SDK代码示例)。无论上传多少,我都会收到这个大丑陋的消息。请帮忙!

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

2 个答案:

答案 0 :(得分:1)

是的,AppFabric Cache正式发布并得到微软的支持。这个链接对教程很有帮助:http://msdn.microsoft.com/en-us/gg457897 但是,使用这种方法还有一个额外的计费方面,而Tablestoragesessionprovider使用BlobStorage,即花生。

答案 1 :(得分:0)

这些示例的优势在于提供了代码,因此您通常可以仔细查看出现的问题。我看了一下,你得到这个错误的最可能的原因是会话状态提供程序的配置有错误(它可能指向错误的帐户)或者表和容器不存在于那个帐户。

有可能没有可用的会话对象,但我发现这不太可能。

话虽如此,表存储会话提供程序是not suitable for releasing in a production environment。无论是使用SQL Server session provider还是使用A pp Fabric cache session provider,你都会好得多。