I am trying to support both WP7 & WP8 in a same solution to use more recent libraries on recent devices. However, it doesnt seem to work...
Here is what i did :
- Copied the project folder, renamed it and the project name inside of it to projectName8
- Added a new project (the copy) into the solution
- Upgraded the new project to WP8
- Added the WP8 tag in the build settings of the windows 8 one
- Deleted the MainView.xaml file from new one and linked the other projects one
- Added a control loop like
#if WP8 XXXXX #else YYYYYY #endif
However, when I debug the app on a windows 8 phone, the YYYYY instruction is called.... I really don't know how it comes and this is really boring... I noticed something wierd : In my code, only the YYYYY istruction is grayed. The other one is in normal color. Mabe is it a syntax error but I couldn't tell you.
#if WP8
currentScore.Text="heho"; //Normal color
#else
currentScore.Text="WP7"; //Gray color <=This line is called only
#endif