I have a clean, Windows 7 x64 box setup to build and run Windows Phone 7 projects. I installed Windows Phone Developer Tools 7.0, January 2011 Update and Windows Phone Developer Tools Fix as per the MSDN App Hub page. My WP7 applications build fine in VisualStudio, yet when I try to use MSBuild.exe, even on the simplest Visual Studio project
c:\Windows\Microsfot.NET\Framework64\v4.0.30319\MSBuild.exe .\SimpleWP7.sln
I get the following errors (with added space between lines for readability)
... verbose.output ...
C:\Program Files (x86)\MSBuild\Microsoft\Silverlight for Phone\v4.0\Microsoft.Silverlight.Common.targets(185,9): error MSB4018: The "CompileXaml" task failed unexpectedly.\r [C:\Users\alasdair.mccall\vs_workspace\SimpleWP7\SimpleWP7\SimpleWP7.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\Silverlight for Phone\v4.0\Microsoft.Silverlight.Common.targets(185,9): error MSB4018: System.IO.FileLoadException: Could not load file or assembly 'PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)\r [C:\Users\alasdair.mccall\vs_workspace\SimpleWP7\SimpleWP7\SimpleWP7.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\Silverlight for Phone\v4.0\Microsoft.Silverlight.Common.targets(185,9): error MSB4018: File name: 'PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'\r [C:\Users\alasdair.mccall\vs_workspace\SimpleWP7\SimpleWP7\SimpleWP7.csproj]
...
What am I missing here? I have Silverlight 3 and 4 installed and I've installed everything as documented on the App Hub. Please let me know if there is any additional information required.
Cheers, Alasdair.