Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

How to correct it?

like image 611
Jader Dias Avatar asked Aug 20 '09 14:08

Jader Dias


2 Answers

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

like image 78
Oliver Avatar answered Nov 04 '22 17:11

Oliver


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

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

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

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

like image 41
David R. Longnecker Avatar answered Nov 04 '22 16:11

David R. Longnecker