MSB4226 error

I am getting a build error in the nuget restore step. The error applies to my UWP projects, for example:

/Users/vagrant/git/SalesApp/SalesApp.Windows/SalesApp.Windows.csproj(149,11): error MSB4226: The imported project "/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/xbuild/Microsoft/WindowsXaml/v15.0/Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Also, tried to find "Microsoft/WindowsXaml/v15.0/Microsoft.Windows.UI.Xaml.CSharp.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "/Library/Frameworks/Mono.framework/External/xbuild/" . These search paths are defined in "/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/MSBuild.dll.config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.

I don’t really know where to start - any suggestions?

1 Like

If this is any help, I have run a build using a workflow and github branch that worked perfectly yesterday, but fails today.

Hi @freever,

seems like either a Xamarin version issue (did you try to build the project with the latest Xamarin Studio on your Mac?), or a dependency issue (version or missing dep).

If that wouldn’t help, can you please send us the build’s bitrise.io URL through email or the onsite chat?

Solution reported by @freever in email:

It seems to be related to the version of nuget. If we change the nuget [version in the nuget] restore step to use [nuget] 4.1.0 instead of “latest version” the problem disappears.