Question
I have a Windows Runtime solution with some C++ projects and C# projects. Visual Studio builds the solution fine. However, MSBuild does not work well with the solution and always ends in Error MSB4096.
Does anyone have idea how to solve it so that MSBuild can build as well as Visual Studio.
Command
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /t:Rebuild /p:VisualStudioVersion=12.0;Platform=x86;Configuration=Debug;VCTargetsPath="C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120";OutDir=C:\Temp1\ /m /verbosity:minimal /nologo C:\Stash\Windows\xxx.sln > C:\Temp1\Log.txt
Error
Creating library ...\OutPut\M.WindowsPhone\M.WindowsPhone.lib and object ...\OutPut\M.WindowsPhone\M.WindowsPhone.exp M.WindowsPhone.vcxproj -> ...\OutPut\M.WindowsPhone\M.WindowsPhone.dll C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(1893,5): error MSB4096: The item "...\SDK\M\M\M.Shared......\BlackboardMobile\businessLogic\student\AutoSavingObserver.cpp" in item list "ClCompile" does not define a value for metadata "DefiningProjectDirectory". In order to use this metadata, either qualify it by specifying %(ClCompile.DefiningProjectDirectory), or ensure that all items in this list define a value for this metadata. [...\SDK\M\M\M.WindowsPhone\M.WindowsPhone.vcxproj] Done Building Project "...\SDK\M\M\M.WindowsPhone\M.WindowsPhone.vcxproj" (Rebuild target(s)) -- FAILED. Done Building Project "...\Student.sln" (Rebuild target(s)) -- FAILED.
%C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe
)? Because that is what VS 2013 (12.0) uses. β Christian.K