EF6 Connector in Azure

We have a site and sql server on Azure. We have included the Entity Framework connection string in the Azure Portal, but we get the following error: The connection string 'MyEntities' in the application configuration file does not contain the required providerName attribute.

Looking at the connection string, it obviously has a provider:

metadata = res: ///MyEntities.csdl | res: ///MyEntities.ssdl | res: //*/MyEntities.msl; provider = System.Data.SqlClient; provider connection string = "data source = tcp: myserver.database.windows.net, 1433; initial directory = mydatabase; user id = user @myserver; password = PASSWRD; MultipleActiveResultSets = True; App = EntityFramework" "providerName =" System. Data.EntityClient "

so what is he asking for? We also replace "with regular quotation marks, but we still get this error.

When using the same connection string in our development and connecting to the azure sql server, everything works, but for some reason the connection string that we put in the portal, which replaces the one in web.config, has problems.

Any help would be appreciated

+4
source share
2 answers

providerName. , web.config, , . . , web.config, , web.config, , Azure Portal [Connection Strings]. . SQL Azure EF Azure

0

Web.Config. ConnectionStrings Add, Element, ConnectionString ProviderName . Add Element ProviderName. , . providerName = "System.Data.EntityClient" connectionString, , !

 <connectionStrings>
        <add 

       name="XXXXXXContainer" 

       connectionString="metadata=res://*/XXXXXX.csdl|res://*/XXXXXX.ssdl|res://*/XXXXXX.msl;
       provider=System.Data.SqlClient;
       provider connection string=&quot;
       data source=chibitestdbserver.database.windows.net;
       initial catalog=XXXXXX;
       persist security info=True;
       user id=chibionos;
       password=XXXXXXXX;
       MultipleActiveResultSets=True;
       App=EntityFramework&quot;" 

      providerName="System.Data.EntityClient" />
      </connectionStrings>
-1

Source: https://habr.com/ru/post/1626796/


All Articles