I tried the following msbuild script (with most irrelevant code removed):
<ItemGroup>
<EmbeddedResource Include="$(ResourceLocation)logom.ico">
<Id>resources.icon.m</Id>
</EmbeddedResource>
<EmbeddedResource Include="$(ResourceLocation)logo.png">
<Id>resources.image.banner</Id>
</EmbeddedResource>
</ItemGroup>
<Target Name="build" Inputs="@(Compile)" Outputs="$(OutputPath)$(AssemblyName).exe">
<ItemGroup>
<EmbeddedResource>
<TaggedResource>$([System.String]::Copy('$(ResourceLocation)%(Filename)%(Extension),%(Id)'))</TaggedResource>
</EmbeddedResource>
</ItemGroup>
<Csc
Sources="@(Compile)"
Resources="@(EmbeddedResource->'%(TaggedResource)')"
/>
</Target>
which results in output like this (i trimmed some unrelated output):
BuildTools\MSBuild\15.0\Bin\Roslyn\csc.exe /resource:"res\logom.ico,resources.icon.m" /resource:"res\logo.png,resources.image.banner"
I'm trying to take advantage of the optional "identifier" argument for the resource parameter of the Csc task. I think it fails because the output gets quotes around each item, so the Csc task thinks the entire thing is the file name. How can i specify these resource value & argument pairs without the quotes?
This is my first msbuild script, so i could easily be way off target.
to get the desired result:
...because "LogicalName" is the metadata entry corresponding to the "identifier" argument.