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 :
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 :
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 :
<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).
And in the C# code :
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.