Short answer: you cannot do what resx does, because a special "toolchain magic" is required to support this.
Visual Studio has special processing for embedding resources referenced by resx files.
Resource resx files use XML syntax to describe what goes into the resource. If you open the file in text editor, you should see something like this:
<data name="TextFile1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>textfile1.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
When you compile your project, this file is processed by a custom tool set for your resx file, ResXFileCodeGenerator. When it sees data nodes of ResXFileRef
type, it reads the content of TextFile1.txt
, and embeds it into the compiled version of Resource1
.
The tool ignores None
/Do not copy
settings on the file itself. In fact, if you set Build Action property to "Embed resource", the content of the file would be embedded twice.