1

私はしばらくこれに取り組んでいますが、もう何をすべきかわかりません..ここに問題があります。

完全にローカルで動作する Azure Webservice があります。Azure SQL データベースに接続する必要があります (デバッグと Azure に同じ ConnectionString を使用するため、正しいはずです)。

IntelliTrace を使用すると、次のエラーが見つかります。

Requested registry access is not allowed.
System.IO.FileNotFoundException Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=Neutral....
System.Data.Entity.Core.ProviderIncompatibleException
System.Data.SqlClient.SqlException    A network-related or instance-specific error occured while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct... (This about 50 times)
System.Threading.WaitHandleCannotBeOpenedException              No handle of the given name exists.
System.Security.SecurityException          Requested registry access is not allowed
Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironmentException        error 
System.Threading.WaitHandleCannotBeOpenedException            No handle of the given name exists.

(例外スタック、最新のトップ、最古のボット)

私の web.config では、次のように EF と ConnectionString をセットアップします。

<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="EntityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework" requirePermission="false"/>
</configSections>
<connectionStrings>
  <add name="DefaultConnection" connectionString="Server=SERVER.database.windows.net;Database=LeagueMetaDatabase;User ID=USER@ksew7pk8ad;Password=PW;Trusted_Connection=False;Encrypt=True;" providerName="System.Data.SqlClient"/>
</connectionStrings>

また、EF アセンブリの「特定のバージョン」を無効にし、「ローカル コピー」を有効にしました。サーバー上のサービスの bin フォルダーをチェックインすると、dll がそこにあります。

このサービスは多くの非同期を使用しますが、すでに述べたように、ローカルで動作します..問題ではないことを確認するために、サーバーに.NET 4.5.1もインストールしました

// 編集 まず最初に、これまでのすべてのヘルプに感謝します!

問題を絞り込んでみました.穴プロジェクトを再構築し、機能しないものを見つけようとしました。非同期タスクは、Azure サーバー クラウドの Web.config で ConnectionString を読み取ることができないようです。エミュレータでは動作します。ConnectionString を Context にハードコーディングしましたが、このように機能しています。

この動作の原因と、それを Web.config に戻す方法を教えてください。

4

3 に答える 3

2

ソリューションはどのように Azure にデプロイされていますか? クラウド サービスまたは Web サイトを使用していますか? Azure Web サイトを実行している場合、問題は接続文字列名が web.config と Azure Web サイトの両方で同じであることに関連している可能性があります。この場合、Web サイトの Azure 管理ポータルで定義されている接続文字列の名前を変更してみてください。これは、構成管理ページから実行できます。

お役に立てれば。

于 2013-10-17T20:16:04.333 に答える