Search code examples
visual-studiowindows-phone-7

How to create multiple applications from one solution in Visual Studio?


I read about this question on referencing one project into another and this question on creating multiple targets for an application, but none really answers my question.

How can I output two different applications where the only difference is the application name, icon and splashscreen? Everything else would be the same apart from some small details that I handled with conditional compilation symbols.

I have four configurations: App1_Debug, App1_Release, App2_Debug and App2_Release, so ideally the output would be based on the active configuration.


Solution

  • Note that it's probably useless to change the application name. The name you see on the phone is the name defined in the manifest, and the manifest is automatically generated from the information you provide when publishing the app on the marketplace.

    Now to answer your question, you can inject a custom manifest and a custom splashscreen in your app using a post-build event: http://blogs.codes-sources.com/kookiz/archive/2012/01/12/wp7-inject-a-file-in-a-xap-using-post-build-event.aspx

    Basically, create a folder in your solution, and put the custom manifest and splashcreen inside. Then define the post-build event of your configuration to inject the appropriate files. You can inject different files simply by setting different post-build events for each of your configuration (App1_Debug, App2_Debug, ...).

    I don't know if it'll work for the icon. In the solution explorer, click on the icon, and check the properties. If its build action is set to 'Content' then it should work.