Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy to Output Directory for images not working + Visual Studio 2010

I am currently developing an application using C# WPF. I am making a website help file system for my program. I am creating the HTML files in the default project file location (i.e. where all the .cs files are stored).

On the HTML files I want to copy I have right clicked on each file and said include in project and said Copy If Newer under Copy to Output Directory.

This is working fine with HTML files but for image files (png) it is not doing anything but there is no error either.

like image 948
Boardy Avatar asked Mar 04 '11 18:03

Boardy


People also ask

How do I change the output path in Visual Studio?

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.

What is the use of copy to output directory Visual Studio?

"Copy to Output Directory" is the property of the files within a Visual Studio project, which defines if the file will be copied to the project's built path as it is. Coping the file as it is allows us to use relative path to files within the project.

What is output directory?

The Output Directory—Applies to both synthesis and simulation generation. By default, the path of the generation output directory is fixed relative to the . qsys file. You can change the default directory in the Generation dialog box for legacy devices.


1 Answers

The BuildAction property indicates what Visual Studio does with a file when a build is executed. BuildAction can have one of several values:

None - The file is not included in the project output group and is not compiled in the build process. An example is a text file that contains documentation, such as a Readme file.

Compile - The file is compiled into the build output. This setting is used for code files.

Content - The file is not compiled, but is included in the Content output group. For example, this setting is the default value for an .htm or other kind of Web file.

Embedded Resource - This file is embedded in the main project build output as a DLL or executable. It is typically used for resource files.

Sounds to me like you want Content.

like image 111
Bob G Avatar answered Nov 17 '22 01:11

Bob G