[ACCEPTED]-Why the web.config isn't copied when I publish an ASP.NET Web Project with the "Only files needed to run this application" option?-web-config

Accepted answer
Score: 11

"Only files needed to run this application" means 6 any build output files like DLLs and references 5 in the bin folder and any files that have 4 a Build Action of Content.

Since the web.config 3 is neither of these, you'll have to change 2 the publish option to All Project Files, or 1 else copy the web.config manually.

Score: 9

When you say 'ASP.NET web project', do you 7 mean 'ASP.NET web application project'?

If 6 so, the web.config should have a build action 5 of Content by default. As Brandon mentioned, Content 4 is then copied over to the publish destination.

To 3 verify, select the web.config file in your 2 Solution Explorer then use the Properties 1 Window. An example:

example http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&id=558

Score: 6

I know it sounds silly but make sure it 2 is marked as 'Content' as it's Build Action 1 under it's properties.

More Related questions