Note that there are some explanatory texts on larger screens.

plurals
  1. POWindows Azure Web Service, Fails to Connect to SQL Database
    text
    copied!<p>I'm working on this for some time and I have no idea anymore what to do.. so here is the problem.</p> <p>I've got a Azure Webservice, which works perfectly localy. It should connect to a Azure SQL Database (I use the same ConnectionString for debug AND azure.. so it SHOULD be right)</p> <p>Using IntelliTrace, I find these Errors:</p> <pre><code>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. </code></pre> <p>(Exception stack, top newest, bott oldest)</p> <p>In my web.config I setup EF and ConnectionString like this:</p> <pre><code>&lt;configSections&gt; &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt; &lt;section name="EntityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework" requirePermission="false"/&gt; &lt;/configSections&gt; &lt;connectionStrings&gt; &lt;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"/&gt; &lt;/connectionStrings&gt; </code></pre> <p>I also deactivated "Specific Version" for the EF assembly and activated "Copy Local". I checked in the bin folder of the service on the server, the dll is there.</p> <p>The service uses a lot of async, but as already said it works localy.. I also installed .NET 4.5.1 on the server just to be sure that is not the problem</p> <p>// Edit First of all, thanks for all the help so far!</p> <p>I tried narrowing the problem down.. reconstructing the hole project and trying to find what does not work. It seems that async Tasks can NOT read the ConnectionString in the Web.config on the Azure Server Cloud. In the emulator, it works. I hardcoded the ConnectionString into the Context and it is working this way.</p> <p>Anyone can tell me what creates this behaviour and how I can put it back into the Web.config?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload