Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2010 "Copy to output directory" not working?

I'm trying to publish my web solution to the file system, using the "Only files needed to run this appllication" option.

I have the following problems:

a) I have a connectionStrings.config file that should be included; I've marked this file as Content and Copy Always.

b) For testing purposes, I've added a textfile.txt that should not be included; I've marked this as Content and Do Not Copy.

Both of these settings fail... It seems that the setting "Copy to output directory" is simply disregarded.

Any ideas why this happens, and what to do about it?

like image 496
Anders Avatar asked Jun 24 '10 10:06

Anders


1 Answers

The "Copy to output directory" is for when you are building your application, not publishing it.

This property specifies the conditions under which the selected source file will be copied to the output directory. Select Do not copy if the file is never to be copied to the output directory. Select Copy always if the file is always to be copied to the output directory. Select Copy if newer if the file is to be copied only when it is newer than an existing file of the same name in the output directory.

Source

There's more information on publishing web sites and applications here

like image 62
ChrisF Avatar answered Sep 21 '22 09:09

ChrisF