Reputation: 1628
I recently made an app for Windows Phone 8, and now I want to be able to run it on older devices with WP7.x as well. Is this possible without having to make a whole new Visual Studio project targeting WP7 instead of WP8? I targeted WP8 to make sure I was not held back on available features, but I don't think I ended up using any features that are not available in WP7 anyway, so now I would like to extend with WP7.x compatibility. Any hints as to how this can be achieved as easily as possible?
Upvotes: 1
Views: 776
Reputation: 6570
Although there's no automated way to "revert" a WP8 project to a WP7 project, it is possible to do it manually, by editing the .csproj file.
I don't have my Windows 8 system handy currently so I can't say for sure which items were involved but looking at the project file for a WP7 project, I (seem to) recall adjusting all or some of the the following lines:
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
<TargetFrameworkProfile>WindowsPhone71</TargetFrameworkProfile>
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
If memory serves, the WP8 project file contains similar lines, and they just need to be replaced with ones above. A comparison between a WP7 project file and WP8 project file should get you on your way. Of course, there might be dependencies that need to be removed or added too.
Otherwise, there's always the option to start a completely new project :)
Upvotes: 3
Reputation: 16361
You need to create a new WP7 project. There may be a way to edit you project and solution files but it would be quicket to just create a new WP7 project and add your existing code to t.
Btw. you should do it the other way around, start with WP7 and upgrade the project to WP8 only if you need the (very few) new features in WP8.
Upvotes: 2
Reputation: 15268
You will inevitably have to create another project that targets WP7.x
But that can be relatively easy, especially if you don't use WP8-only features.
To improve maintainability, you should consider sharing reusable code files between projects, for example by taking advantage of the "Add as link" functionality of Visual Studio.
Upvotes: 1