c# - Azure Publish Database First Connection String Not Working -


i have gone through steps publish web app using database first on azure portal.

however, when publish error message:

code generated using t4 templates database first , model first development may not work correctly if used in code first mode. continue using database first or model first ensure entity framework connection string specified in config file of executing application. use these classes, generated database first or model first, code first add additional configuration using attributes or dbmodelbuilder api , remove code throws exception.

my connection string in web.config after has been modified publish:

<add name="mysiteentities" connectionstring="metadata=res://*/mysite.csdl|res://*/mysite.ssdl|res://*/mysite.msl;provider=system.data.sqlclient;provider connection string=&quot;data source=tcp:**********.database.windows.net,****;initial catalog=mysite;user id=username@**********;password=*******;multipleactiveresultsets=true&quot;" providername="system.data.entityclient" /> 

my context (generated edmx):

public partial class mysiteentities : dbcontext {     public mysiteentities()         : base("name=mysiteentities")     {     } ... 

i confused becuase seems entity framework trying use code first rather database first.

update: tried using same connection string locally , web app seems run fine. web app connect remote database fine. when publish azure fails.

read answer similar question @ entity framework work locally not on azure.

if made same "mistake" did, what's happening ... azure-deployed app isn't finding connection string "mysiteentities" inside web.config. instead, @ time created azure web site (or cloud service or whatever), created associated azure sql database , gave connection string exact same name, "mysiteentities". latter connection string "plain" connection string without model/database-first metadata references, , being treated code-first connection ef, complains conflict. see code first vs. database first explanation of distinction.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -