我在构建时使用 MSBuild 动态生成资源文件,但为了能够在运行时读取该资源文件,我需要它成为嵌入式资源。
我到处都在研究如何在 a 中标记文件.csproj
作为嵌入式资源,我什至尝试过这一点,但没有成功。
<ItemGroup>
<Content Include="Infrastructure\Content\Store\content_store_en.json" />
<EmbeddedResource Include="Infrastructure\Content\Store\content_store_en.json">
</EmbeddedResource>
</ItemGroup>
有什么办法可以实现这个目标吗?
操作方法如下:
<Target Name="BeforeBuild">
<CreateItem Include="Infrastructure\**\*.json">
<Output ItemName="EmbeddedResource" TaskParameter="Include" />
</CreateItem>
</Target>
Source: http://ayende.com/blog/4446/how-to-setup-dynamic-groups-in-msbuild-without-visual-studio-ruining-them http://ayende.com/blog/4446/how-to-setup-dynamic-groups-in-msbuild-without-visual-studio-ruining-them
我更改了 CreateItem 属性,因此它将反映您的问题。
我希望它有帮助...
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)