[英]WPF project mutiple and different builds under VS2015 express
I have a WPF project under VS2015 express (eventually I can switch to VS2017) for which I wish to have several builds that differs in : 我在VS2015 Express下有一个WPF项目(最终我可以切换到VS2017),我希望拥有几个不同的版本:
For example : 例如 :
Ideally, I'd like if all can be built in one click 理想情况下,我想一键构建所有内容
Is that possible ? 那可能吗 ? And how ? 如何 ?
Thx 谢谢
Ok, I looked at MSbuild and I kinda partly solved my problem in these ways : 好的,我查看了MSbuild,并通过以下方式部分解决了我的问题:
First I created one project configuration for each case I wish to build. 首先,我为要构建的每种情况创建了一个项目配置。 Then... 然后...
I closed the VS project and changed the .csproj file this way : 我以这种方式关闭了VS项目并更改了.csproj文件:
<PropertyGroup>
<ApplicationIcon Condition=" '$(Configuration)' == 'Release' ">LogoMini.Soc1.ico</ApplicationIcon>
<ApplicationIcon Condition=" '$(Configuration)' == 'Debug' ">LogoMini.Soc1.ico</ApplicationIcon>
<ApplicationIcon Condition=" '$(Configuration)' == 'Soc2' ">LogoMini.Soc2.ico</ApplicationIcon>
</PropertyGroup>
[...]
<ItemGroup>
<SplashScreen Condition=" '$(Configuration)' == 'Debug' " Include="Images\SplahScreen.Soc1.png" />
<SplashScreen Condition=" '$(Configuration)' == 'Release' " Include="Images\SplahScreen.Soc1.png" />
<SplashScreen Condition=" '$(Configuration)' == 'Soc2' " Include="Images\SplahScreen.Soc2.png" />
</ItemGroup>
It kinda work, but : 有点工作,但是:
I added in My Projects > Properties > Build > Conditional compilation symbols the symbol SOCi (for each project configuration i). 我在“我的项目”>“属性”>“构建”>“条件编译”符号中添加了符号SOCi(针对每个项目配置i)。
And in the C# code : 并在C#代码中:
int MyVar;
#if SOC1
MyVar = 1;
#elif SOC2
MyVar = 2;
#endif
That is fine I guess. 我想那很好。
I will wait a while before marking this as the solution in case someone as a comment or correction to do. 我将稍等片刻,然后将其标记为解决方案,以防有人评论或更正。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.