views:

22

answers:

1

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?

A: 

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

ChrisF
OK, but how do I specify what is included/excluded when publishing?(My site will crash if the connectionStrings.config file is not included, and I don't intend to copy it manually...)
Anders
It's obvious that the buildaction plays a part here; I've experimented by setting the build-action of my textfile.txt to None, and then the file does not show up in the publish directory. As explained above, it does show up in the publish directory when the action is Content, even if it's set to Do Not Copy.How can I control what is included in the publish?(In VS2008, I used the Do Not Copy / Copy Always setting, and it worked.)
Anders
@Anders - Sorry I can't be of more help.
ChrisF

related questions