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="data source=localhost\sqlexpress;initial catalog=xxxx;integrated security=true;multipleactiveresultsets=true;application name=entityframework"" 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
Post a Comment