C#. It is "installer" that copy files - embedded resources - to some location.msbuild.exe.The problem here is that if anyone want to add another file (or remove existing file) they have to do it manually through Visual Studio.
Is there some way how one can do this automatically?
Example:
I have folder embeddedResources and in there I have files a.txt and b.txt. Both set as Embedded resources. Is there some automatic way, how to add new file c.txt as Embedded resource if I copy it to the folder embeddedResources? Or how to successfully build the solution if I delete the file a.txt?
Just add following ItemGroup into your .csproj:
<ItemGroup>
<EmbeddedResource Include="embeddedResources/*.txt" />
</ItemGroup>
Every file in embeddedResources folder with .txt extension will be automatically set as embedded resource.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With