2011-01-29 9 views
0

ローカルシステムを使用して、Windows Azureでセッションをテストします。私は、web.configファイルにWindowsでのセッションの設定azure

<appSettings> 
    <!-- account configuration --> 
    <add key="TableStorageEndpoint" value="http://127.0.0.1:10002/devstoreaccount1/" /> 
    <add key="BlobStorageEndpoint" value="http://127.0.0.1:10000/devstoreaccount1/" /> 
    <add key="AccountName" value="devstoreaccount1" /> 
    <add key="AccountSharedKey" value="Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" /> 
    <add key="DefaultMembershipTableName" value="Membership" /> 
    <add key="DefaultRoleTableName" value="Roles" /> 
    <add key="DefaultSessionTableName" value="Sessions" /> 
    <add key="DefaultProviderApplicationName" value="ProviderTest" /> 
    <add key="DefaultProfileContainerName" /> 
    <add key="DefaultSessionContainerName" /> 
    </appSettings> 
    <system.web> 

    <sessionState mode="Custom" customProvider="TableStorageSessionStateProvider"> 
     <providers> 
     <clear /> 
     <add name="TableStorageSessionStateProvider" type="Microsoft.Samples.ServiceHosting.AspProviders.TableStorageSessionStateProvider" /> 
     </providers> 
    </sessionState> 
</system.web> 

を、以下の設定を行っているが、今私は

Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Exception has been thrown by the target of an invocation.

Source Error:

Line 39: Line 40:
Line 41: Line 42: Line 43:

Source File: C:\Users\GizaKarthik\Desktop\SessionDemo\SessionDemo\SessionDemo_WebRole\web.config Line: 41

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.WindowsAzure.StorageClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

答えて

0

次のエラーを取得exeption理由は、私が破損したDLLを使用したことです。追加のC#の例をhereからダウンロードしてください。検索ASPは

TableStorageSessionstateProvider

のコードが次にコンパイルしたDLLを使用して、この

  else 
      { 
       try // Added try statement 
       { 
        // Read Items, StaticObjects, and Timeout from the file 
        byte[] items = Convert.FromBase64String(reader.ReadLine()); 
        byte[] statics = Convert.FromBase64String(reader.ReadLine()); 
        int timeout = session.Timeout; 
        // Deserialize the session 
        result = DeserializeSession(items, statics, timeout); 
       } 
       catch (Exception e) // Added catch statement 
       { 
        // Return an empty SessionStateStoreData 
        result = new SessionStateStoreData(new SessionStateItemCollection(), 
                 SessionStateUtility.GetSessionStaticObjects(context), 
                 session.Timeout); 
       } 

      } 

で上記のコードを置き換えます。このコード

  else    
      {  
        byte[] items = Convert.FromBase64String(reader.ReadLine()); 
        byte[] statics = Convert.FromBase64String(reader.ReadLine()); 
        int timeout = session.Timeout; 
        // Deserialize the session 
        result = DeserializeSession(items, statics, timeout); 

      } 

を見つけ、プロジェクトの編集を提供します。それはチャンピオンのように動作するはずです。幸せなコーディング!

関連する問題