Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy always to output directory does not work

People also ask

How do I copy output in Visual Studio?

Copy to Output Directory is a property for files within a Visual Studio project. Select a Windows Form in a project, find Copy to Output Directory and note Copy to Output Directory is set to [Do not copy].

How do I change the output path?

Right-click on the project node in Solution Explorer and select Properties. Expand the Build section, and select the Output subsection. Find the Base output path for C#, and type in the path to generate output to (absolute or relative to the root project directory), or choose Browse to browse to that folder instead.

How do I copy a folder in Visual Studio?

Use the CopyDirectory method to copy a directory to another directory. This method copies the contents of the directory as well as the directory itself. If the target directory does not exist, it will be created.


In the file properties in Visual Studio, set:

Build action: None

Copy to output directory: Copy always


Changes to non-source code files don't cause a rebuild to occur - they aren't considered when the compiler does it's out of date checking.

Try forcing a complete rebuild by deleting your output directory completely (sometimes doing this from within Visual Studio isn't complete).

It may be that the files haven't been copied across because a full build hasn't been run.


None of this worked for my WPF project. You need to mark it Content + Copy Always.

Refer to this page for details on the different Visual Studio file properties.


Did you mark them as content?