Monday, August 17, 2015

Using Conditional Compilation Symbols

Problem:
I have a Portable Change Library (PCL) as core project in a mobile MVVMCross solution.  The code supports Anrdroid, Windows Phone and iPhone.  I have been trying to compile specific code for use with Windows Phone.  I had the code working but was unsure how to proceed to support the other 2 UIs which use the PCL.

Solution:
I read John Atten's excellent article on how to leverage Conditional Compilation on Visual Studio.
I defined the tag - MVVMCross_WP8 and added that to the build profile for Windows Phone.  I added the tag in the properties > build for the PCL core.


Source:
http://typecastexception.com/post/2012/08/18/Visual-Studio-Use-Conditional-Compilation-to-Control-Runtime-Settings-for-Different-Deployment-Scenarios.aspx

No comments:

Post a Comment