c# - Azure Entity Framework connection string failing -


everything works great when run project locally, when deploy azure following error.

"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 is:

add name="lifeentities" connectionstring="server=tcp:abc000000ab.database.windows.net,1433;database=life;user id=myid@abc000000ab;password=mypw;trusted_connection=false;encrypt=true;connection timeout=30;" providername="system.data.sqlclient" 

i'm getting error when code tries open context of entity framework database. note, i'm using pretty basic mvc project template asp.net identity well.

i've read because of code first vs data not sure how solve issue.

that's pure sql connection string. need use ef connection string, including model metadata etc.

here's example:

<add name="context" connectionstring="metadata=res://*/context.csdl|res://*/context.ssdl|res://*/context.msl;provider=system.data.sqlclient;provider connection string=&quot;data source=.;initial catalog=context;integrated security=true;multipleactiveresultsets=true;&quot;" providername="system.data.entityclient" /> 

Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -