2
votes

I had to format my computer, reinstall all Visual Studio and Xamarin stuff , but after that, my old projects and new ones throws this error:

The imported project "C:\Program Files (x86)\Windows Kits\10\bin\10.0.14393.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\8.21\Microsoft.Windows.UI.Xaml.Common.targets

I can't even understand this error, or find anything in Google. The first file address is different than the second, it doesn't make sense. The second one, is the actual one in my UWP.csproj and it is in my drive at this location. The first file address I have no idea where it's coming from and it's not in my drive. The 10.0.14393.0 folder doesn't exist in my drive.

Any idea how to understand this problem and fix it?

Thanks

EDIT: After formatting my computer again and reinstalling the entire Visual Studio/Xamarin suite, I verified that both paths exists in my computer. I wonder what happened.

1
are you able to locate this folder `C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\8.21` on your PC ?Mit Bhatt
Yes, this one I can find and the file is there. The first file address I can't find though.Dpedrinha
Had similar problem. "repairing" Xamarin - In "Control Panel\Programs\Programs and Features" Fixed it.MotKohn
Try this, create a completely new Blank App, and open its .csproj in text editor. If this file Microsoft.Windows.UI.Xaml.Common.targets is mentioned in the newly created .csproj then copy it's path to your old .csproj file. Then reopen the projectMit Bhatt
New Cross-platform projects doesn't even create the UWP project. It throws some pop-up windows with crazy errors. One of them is even blank.Dpedrinha

1 Answers

0
votes

Right click .csproj file on the Solution Explorer that is SampleProject(load failed) then right click select Edit Solution. Once you got there then find TargetPlatformVersion tags, it also has decimal value like this 10.1.17882.0 blablabla something like that... Then Open folder C:\Program Files (x86)\Windows Kits\10\bin you will see version SDK folders there, then copy FOLDER NAME of the latest version SDK folder and PASTE or replace value 10.1.17882.0 in TargetPlatformVersion tags SAME with TargetPlatformMinVersion tags but lower version of SDK on the .csproj file. Right click and reload project cheers!