If you use <FileConstant Include="FULL_PATH" />, you will get a compilation error.
This happens because we attempt to use %(RelativeDir) to build the area, and things go awry if the path is absolute.
It's quite common for files to be included and linked, when sourced from an absolute path, so that the copying to the output directory is a certain relative path. We should detect this condition and use the link instead of the RelativeDir and Filename/Extension in that case.
Examples:
<Content Include="$(RootDir)\data.txt" Link="Content\data.txt" />
<FileConstant Include="@(Content)" />
should result in a constant ThisAssembly.Constants.Content.data = @"Content\data.txt";
If you use
<FileConstant Include="FULL_PATH" />, you will get a compilation error.This happens because we attempt to use
%(RelativeDir)to build the area, and things go awry if the path is absolute.It's quite common for files to be included and linked, when sourced from an absolute path, so that the copying to the output directory is a certain relative path. We should detect this condition and use the link instead of the RelativeDir and Filename/Extension in that case.
Examples:
should result in a constant
ThisAssembly.Constants.Content.data = @"Content\data.txt";