Not everything copied to your output directory, setting CopyToOutputDirectory
, is copied to the content output group. So you can do this:
File1---CopyToOutputDirectory = Copy always, Content File2---CopyToOutputDirectory = Copy always, Content File3---CopyToOutputDirectory = Copy always, None
All three files will be copied to the output directory, but only File1
and File2
will be copied to the Content Output Group.
In addition, Content
allows you to extract the file (in the same directory as the assembly) as a stream through Application.GetContentStream(URI)
. For this method to work, it needs the custom attribute AssemblyAssociatedContentFile
, which Visual Studio adds when you mark the file as Content
.
None
and Content
are values ββfor how the file relates to the build and deployment process. Thus, your build (for example, MS Build) and deployment may be different from simply deleting files from the output directory. You may have a .bat file that you really don't need in the output directory, but you need it to deploy.
This SO answer provides more details on the various build actions.
source share