2011-04-28 49 views
0

我最近在將新Azure應用程序部署到新服務器時發生了一個奇怪的錯誤。我正在使用ASP提供程序(由Microsoft提供的Azure SDK代碼示例)。不管多少次上傳,我都會收到這個醜陋的消息。請幫忙!ASP提供程序項目在Azure環境中失敗

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 

回答

0

的優點與這些樣品是,提供代碼,這樣你就可以得到一般在什麼地方出了錯一探究竟。我看了一下,得到這個錯誤的最可能原因是會話狀態提供程序的配置有錯誤(它可能指向錯誤的帳戶),或者表和容器不存在於該帳戶。

有可能沒有會話對象可用,但我覺得不太可能。

話雖如此,表存儲會話提供程序是not suitable for releasing in a production environment。您使用SQL Server session provider或A pp Fabric cache session provider要好得多。

+0

感謝您的建議。我的應用程序配置設置是正確的。當我將應用程序部署到另一個(免費)帳戶(具有相同的存儲帳戶)時,它工作得很好。我也嘗試了一些選項,但現在不確定哪一個用於生產。我只想知道這三種方法中的哪一種是由Microsoft正式推薦的? – Rightsideofwrong 2011-04-29 15:23:48

+0

我認爲MS的官方答案是使用應用程序結構緩存提供程序,其他兩個都沒有官方支持。 – knightpfhor 2011-05-01 01:16:36

相關問題