I am just starting to get started with MVC6 and I can't find a simple explanation to a problem I have.
My MVC6 web app has a reference to a .NET business layer, and this references a .NET data layer.
The data layer is looking for a connection string (let's call it XXXX) in the 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 does not have a web.config (in the traditional sense). I have tried to add a connection string to the appsettings.json file, and try to set up the startup.cs file so it references the same name, but each time I try to run it I get an error:
InvalidOperationException: No connection string named 'XXXX' could be found in the application config file.
Can someone give me some straightforward instructions so my appsettings.json and startup.cs can pass a XXXX connection string to my data layer?