Is there any way to create a project/application which will have multiple targets.
Its same as how we create multiple targets for an iPhone application in XCode.
Basically I have an app which has to be made for different targets, with almost all the similar functionalities but with little change.
Asked
Active
Viewed 267 times
1

Amresh Kumar
- 1,445
- 17
- 30
1 Answers
2
You can use Configuration Manager to add additional configurations to the list of Debug and Release. Then for each configuration go to Project/Properties/Build/Conditional compilation symbols and add a symbol used with your configuration or target, eg. make it SILVERLIGHT;WINDOWS_PHONE;CUSTOMVERSION1
Then in your code you can say
#if CUSTOMVERSION1
Debug.WriteLine("This is a CUSTOMVERSION1");
#else
Debug.WriteLine("This is not CUSTOMVERSION1");
#endif
Otherwise - if you want to make bigger changes - you would create another project and link files from one project to another project - project/Add/Existing Item//Add As Link(an option in the "Add" button menu). You can then add more files or add different versions of these files as needed. You could use Project Linker to do it faster.

Filip Skakun
- 31,624
- 6
- 74
- 100
-
The first option is enough for me, but how do i specify different Icons and SplashScreens for different targets?? Is it possible?? – Amresh Kumar Dec 01 '11 at 09:15
-
In my opinion it is not possible: Splash and the 2 app icons are not controlled by the user code. Icons are specified in the WMAppManifest.xml - xml does not support #directives. Splash screen is actually any root image with suitable dimensions. If the loader finds such an image, it will use it as splash. – Jan Slodicka Dec 01 '11 at 09:46
-
You can put the shared code in a shared library and have two app projects using that shared lib. – Filip Skakun Dec 01 '11 at 10:44
-
To change the splash screen at build, you can just add a pre-build event command line that checks the configuration and copies the new splash screen file into the project directory. – Carlos P Dec 07 '12 at 16:59