user857521
user857521

Reputation:

How to deploy a folder containing .cs extensions which are not part of the project

I'm trying to deploy a portable version of Python with a C# Winforms desktop app and the portable folder contains files with extension .cs which are for Python (part of Tk Interface Extensions I think). In the VS editor I get lots of Preprocessor directive expected errors as it believes those files are part of the project.

Essentially everything inside \tools\ is not part of the project but needs to be copied to the project directory ProjectFolder\tools\Portable Python 3.2.5.1\.....

Is there a way to get VS to ignore the folder but still copy the entire contents using Copy to Output Directory?

Is there a better way to do this?

Upvotes: 1

Views: 41

Answers (1)

Servy
Servy

Reputation: 203829

Open up the properties for that item.

  1. Change the build action from "Compile" to "Content".

  2. Change "Copy to Otuput" from "Do no Copy" to "Copy if newer" (or copy always, if you really want that).

So it'll go from this:

enter image description here

to this:

enter image description here

Upvotes: 2

Related Questions