1

Windows Phone 8, C# project. I have some content files that go into my app package as resources (build type "Content"). Depending on build configuration (Debug vs. Release), I want to exclude some of them from the build process. Can I? There's nothing in the properties window to that effect. However, in C++ projects I can do that to individual source files...

4

2 回答 2

4

您也可以进入 .csproj 文件并手动编辑它。在那里,您可以为此设置各种属性。即,将此添加到您只想应用于特定构建的任何内容中:
Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "

示例:
<Content Include="Assets\ReleaseImage.png" Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<Content Include="Assets\DebugImage.png" Condition= " '$(配置)|$(平台)' == '调试|AnyCPU' " />

于 2012-11-16T02:22:19.763 回答
1

不是最简单的,但您可以在命令行上运行构建后事件并使用宏来帮助您。

宏 - $(ConfigurationName) 将帮助您进行调试。

后期构建文档

有用的宏

于 2012-11-15T21:25:02.563 回答