Copy to Output Directory = Copy Always not working for VS2013

2.2k views Asked by At

I have asp.net mvc 5 application and websetup project in a VS2013 solution. I have added the asp.net mvc5 application as the Project output for the web setup project. Now I have web.config files for Areas, Views section. I have set them with Build Action = Content and Copy to Output Directory = Copy Always. On building the web setup project and deploying it to web server ,I see that there are no web.config files for Areas, Views section in the output. Can anyone help me to know how to resolve this issue ?

1

There are 1 answers

0
Matthew K On

The typical setup for an ASP.NET web project does not require copying the web.config to the build folder.

You could selected Build Action "Content" and Copy to Output Directory "Do not copy"

If you Publish your project, the content files will be published. They will not be placed in the bin folder, but rather alongside the app where IIS expects them. The publish step may produce output similar to the following.

Publishing folder bin... Publishing folder Content... Publishing folder Scripts... Publishing folder Views... Publishing folder Views/Home... Publishing folder Views/Shared…

If you must use WebSetup (instead of Publish) to deploy the web app, you will want to add the necessary files to the WebSetup FileSystem tab (including content and output).