.NET Framework with Phone SDK confusion

116 Views Asked by At

Currently I'm experience a very strange problem, which I can't solve by myself.

Environment

  • Windows 8.1
  • Visual Studio 2013 Ultimate Update 1
  • Windows Phone 8 SDK
  • ReSharper 8
  • Xamarin (just to say, I don't think that this is the problem)

I've got a solution containing a single Windows Phone 8 project. Just one from the standard templates, nothing customized yet. I've got a second solution containing a PCL project (call it core if you want). Both solutions/projects are currently independent, since I've got the following problem:

The Problem

If I load the WP8-Solution, everything works as expected. The Visual Phone Designer loads and is working. Having IntelliSense as expected. Debugging on device and simulator works like a charm. Nothing curious.

The next step is to switch to the core solution, make some changes and switch back to the WP8 one.

Now the problems are starting. The Visual Phone Designer does not load due to a markup error. When looking in the xaml code, VS does not recognize anything related to the Windows 8 Phone SDK. IntelliSense stopped working, compilation fails, no start on device or simulator possible. It seems that VS stopped recognizing the project as a WP8 project.

It get's a bit more interesting now. When opening the .csproj file, the root is:

<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

Since I did't know what ToolsVersion exactly does, I looked it up in MSDN. They also provide the registry key (HKLM\Software\Microsoft\MSBuild\ToolsVersions\12.0) where MSBuild finds the correct tools. After looking it up, I saw four entries: 12.0, 4.0, 3.5, 2.0.

For testing I changed ToolsVersion="12.0" to ToolsVersion="4.0" and reloaded the project. bingo: It is working again. It is working until I change to another solution or restart VS. Then I get the same errors again, as described.

The funny part is: If I change the ToolsVersion back to 12.0 it is working again until a solution change or VS restart.

It seems I can do this indefinitely. Very strange behavior.

What I have tried so far

I uninstalled everything: Visual Studio, Resharper, Xamarin, Windows Phone 8 SDK. Run CCleaner (which did not help much I think), restarted the computer and installed everything again.

To be sure, that Resharper or Xamarin don't produce this error, I tried it at first without them and I still got it.

I'm not sure when exactly this kind of problem started, since I had developed some phone apps without that problem.

Thank you for your help, I appreciate it! The problem is getting annoying.

If you need more information, just drop me a comment.

0

There are 0 best solutions below