asp.net core mvc - Use ASP MVC 5 connection string in ASP MVC 6 -


i starting started mvc6 , can't find simple explanation problem have.

my mvc6 web app has reference .net business layer, , references .net data layer.

the data layer looking connection string (let's call xxxx) in web.config:

<configuration>   <connectionstrings>     <add name="xxxx" connectionstring="metadata=res://*/xxxx.csdl|res://*/xxxx.ssdl|res://*/xxxx.msl;provider=system.data.sqlclient;provider connection string=&quot;data source=localhost\sqlexpress;initial catalog=xxxx;integrated security=true;multipleactiveresultsets=true;application name=entityframework&quot;" providername="system.data.entityclient"/>   </connectionstrings> </configuration> 

mvc6 not have web.config (in traditional sense). have tried add connection string appsettings.json file, , try set startup.cs file references same name, each time try run error:

invalidoperationexception: no connection string named 'xxxx' found in application config file. 

can give me straightforward instructions appsettings.json , startup.cs can pass xxxx connection string data layer?


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -