I need to have three different build variants (flavors) of my UWP app that can be installed parallel: one for production, one for testing and one for development. They obviously need to share the same code base but have different constants like backend URLs and API keys.
In Android Studio this can be done using "build variants" and in Xcode this can be done using "schemes". What's the Visual Studio equivalent of those?
Maybe "build configurations" using the Configuration Manager as in https://msdn.microsoft.com/en-us/library/kwybya3w.aspx is the way to go. By default I have a Debug and a Release configuration. Would it be correct to rename those to Production-Debug and Production-Release and then create Testing-Debug, Testing-Release, Development-Debug and Development-Release? What I don't understand though:
EDIT: This is about UWP apps, not about web apps.
If you want to build multiple configurations and platforms in one action, you can use the Build > Batch Build option in Visual Studio. To access this feature, press Ctrl+Q to open the search box, and enter Batch build .
You can just use conditionals like this:
<AppxManifest Include="Manifest.Debug.xml"
Condition="'$(Configuration)'=='Debug'">
<SubType>Designer</SubType>
</AppxManifest>
<AppxManifest Include="Package.appxmanifest"
Condition="'$(Configuration)'=='Release'">
<SubType>Designer</SubType>
</AppxManifest>
Double click on Package.appxmanifest file in your project.
Select Packaging label and enter different Package names for different cases.
Store each of variants.
Your PC gonna think these are different UWP apps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With