ewbi
ewbi

Reputation: 1833

Why is VS 2013 copying ASP.NET MVC 4 web.config to bin and renaming?

I just noticed that during a build, Visual Studio 2013 is copying the web.config from the root of my ASP.NET MVC 4 web app project into the bin folder and renaming it for the resulting web app DLL with a .config extension. It's a straight copy because the files have the same timestamp.

I'm familiar with the build doing this for app.config files in executable Windows/console projects, but why is it doing it for a web app that will depend on web.config at runtime?

Upvotes: 10

Views: 1084

Answers (1)

John Hodge
John Hodge

Reputation: 1715

As best as I can tell, the config file in the bin folder does nothing except to allow you to keep settings that are needed for that DLL in a handy place should you decide to incorporate that DLL into a larger project. In that case you would probably want to merge the config file into the hosting apps config file.

Here's a related question that may give some more insight. What use has the default (assembly).dll.config file for .NET-Assemblies?

Upvotes: 2

Related Questions