DataServiceRequestException与TableStorageSessionStateProvider [英] DataServiceRequestException with TableStorageSessionStateProvider

查看:396
本文介绍了DataServiceRequestException与TableStorageSessionStateProvider的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用TableStorageSessionStateProvider从Azure的培训教材。我可以用这个例子没有问题,但是当我在我的web应用程序使用它,我得到这个异​​常:

I'm trying to use the TableStorageSessionStateProvider from the Azure training kit. I can use the example without problems but when I use it in my web app, I get this exception:

System.Data.Services.Client.DataServiceRequestException occurred
  Message=An error occurred while processing this request.
  Source=Microsoft.WindowsAzure.StorageClient
  StackTrace:
       at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
       at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
       at Microsoft.Samples.ServiceHosting.AspProviders.TableStorageSessionStateProvider.<>c__DisplayClass5.<ResetItemTimeout>b__4()
  InnerException: System.Data.Services.Client.DataServiceClientException
       Message=<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
  <code>UpdateConditionNotSatisfied</code>
  <message xml:lang="en-US">The update condition specified in the request was not satisfied.
RequestId:c552d552-ba1c-4920-84fc-e716705b58b9
Time:2011-02-17T12:43:38.5650557Z</message>
</error>
       Source=System.Data.Services.Client
       StatusCode=412
       StackTrace:
            at System.Data.Services.Client.DataServiceContext.SaveResult.<HandleBatchResponse>d__1e.MoveNext()
       InnerException: 

我试过<一个href=\"http://social.msdn.microsoft.com/Forums/en/windowsazure/thread/8cb4937a-fe1e-42ef-b907-1e5238b2b3e9\"相对=nofollow>这个,但没有运气这么far.I've也看到空引用异常发生的事情,所以我想,它不是行为就像是InProc一个TableStorageSessionStateProvider,所以也许我要检查怎么会在应用中使用。但是,可能是什么问题?

I've tried this, but no luck so far.I've also seen null reference exceptions happening, so I guess that the TableStorageSessionStateProvider it's not behaving like the InProc one, so maybe I have to check how sessions are being used in the application. But, what could be the problem ?

编辑:嗯,我发现,在天青培训工具包的例子,如果你只使用TableStorageSessionStateProvider具有相同的异常也会失败。你只需要评论的其他供应商:

Well, I've find out that the example in the Azure training kit also fails if you only use the TableStorageSessionStateProvider with the same exception. You just have to comment the other providers:


    

<authentication mode="Forms">
  <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>

<!-- Membership Provider Configuration -->
<!--<membership defaultProvider="TableStorageMembershipProvider" userIsOnlineTimeWindow="20">
  <providers>
    <clear />
    <add name="TableStorageMembershipProvider" type="Microsoft.Samples.ServiceHosting.AspProviders.TableStorageMembershipProvider" description="Membership provider using table storage" applicationName="AzureStore" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" requiresUniqueEmail="true" passwordFormat="Hashed" />
  </providers>
</membership>

<profile>
  <providers>
    <clear />
    <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
  </providers>
</profile>

--><!-- RoleManager Provider Configuration --><!--
<roleManager enabled="true" defaultProvider="TableStorageRoleProvider" cacheRolesInCookie="true" cookieName=".ASPXROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All">
  <providers>
    <clear />
    <add name="TableStorageRoleProvider" type="Microsoft.Samples.ServiceHosting.AspProviders.TableStorageRoleProvider" description="Role provider using table storage" applicationName="AzureStore" />
  </providers>
</roleManager>-->

<!-- SessionState Provider Configuration -->
<sessionState mode="Custom" customProvider="TableStorageSessionStateProvider">
  <providers>
    <clear />
    <add name="TableStorageSessionStateProvider" type="Microsoft.Samples.ServiceHosting.AspProviders.TableStorageSessionStateProvider" applicationName="AzureStore" />
  </providers>
</sessionState>
    <machineKey decryption="AES" decryptionKey="F7FA540B4DFD82E5BB196B95D15FF81F5B973B5514F973D2A46B4C52224A3ABC" validation="SHA1" validationKey="5B973B5514F973D2A46B4C52224A3ABC90378EFA9DE62168764FF0DCE537184F0535D5D9AD66DEDC5B973B5514F973D2A46B4C52224A3ABC90378EFA97DC1ABF" />

推荐答案

如果你想知道为什么你收到此错误与 TableStorageSessionProvider 看我的答案<一个href=\"http://stackoverflow.com/questions/3940891/asp-net-mvc-azure-error-accessing-the-data-store/3952346#3952346\">this问题。如果你想了解在Azure中使用SQL会话提供看答案这个问题

If you want to know why you're getting this error with the TableStorageSessionProvider see my answer to this question. If you want to know about the using the SQL session provider in Azure see the answer to this question.

如果你今天需要用的东西,你是唯一真正的选择是使用即使它不支持SQL会话提供。一旦AppFabric缓存超出CTP的将是要走的路。

If you need to use something today, you're only real choice is to use the SQL session provider even though it's not supported. Once AppFabric Caching is out of CTP it will be the way to go.

这篇关于DataServiceRequestException与TableStorageSessionStateProvider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆