When creating an ASP.NET MVC project, a web.config
file gets generated automatically and is used for all the connection strings and dll versions relevant to the solution.
I've added a new project to the solution for handling data operations using Entity Framework and can see that it has it's own app.config
that gets created as well.
Previously, all data and web was on the one ASP.NET project and now I've split them up into two different projects so I can have the web project just have web components and data project have database connections using Entity Framework.
Initially it looked like the app.config
of the data project would require the connection strings to the database be present as well, but it looks like the data project can connect fine to the database using the connection strings from the web.config
file.
I've tried removing the app.config
file completely from the data project and it looks like the solution runs even without it.
Are there any special reasons the app.config
file exists in an ASP.NET MVC project or can this file be safely deleted without affecting the website?
For example, I tried putting in 2 different connection strings, one in web.config
and a different one in app.config
. When accessing the site, it looks like only the connection strings and app variables from the web.config
file is used.
Is there some sort of hierarchy that gets used where the app.config
details will override the web.config
details?