0
votes

VS for Mac updated today May 6, since then the Xamarin XAML preview isn't working for both platforms.

No errors, no information. Just endless blank loading screen.

Downgrading by changing to a 'stable channel' ensures no new xamarin forms project can even compile with the error:

/usr/local/share/dotnet/sdk/2.2.203/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(5,5): Error MSB4018: The "GenerateDepsFile" task failed unexpectedly. System.TypeLoadException: Could not load type of field 'Microsoft.NET.Build.Tasks.DependencyContextBuilder:_filteredPackages' (12) due to: Could not resolve type with token 01000027 from typeref (expected class 'NuGet.Packaging.Core.PackageIdentity' in assembly 'NuGet.Packaging, Version=5.0.0.6,

Has someone found a workaround?

3

3 Answers

0
votes

Yes, it is just the case for Xamarin Previewer,which is really problematic. And we apologize for the inconvenience. The xamarin development team is doing their best to address this issue and we are urging them to release the latest version as soon as possible.

Of course, you can also try other alternate tools ,e.g. LiveXAML and Xamarin live reload For more details, you can check:

https://www.livexaml.com/ https://marketplace.visualstudio.com/items?itemName=Xamarin.XamarinLiveReload

0
votes

I solved the issue by removing the '2.2.203' folder in the 'sdk' folder leaving '2.1.505'.

The part to the folder is 'Macintosh HD⁩ ▸ ⁨usr⁩ ▸ ⁨local⁩ ▸ ⁨share⁩ ▸ ⁨dotnet⁩ ▸ ⁨sdk⁩'

Apparently VS for mac isnt smart enough to point back to the older netstandard after switching from preview to stable channel.

0
votes

As stated yes the Xaml preview is broken.

However to fix the error you are getting with downgrading VS for Mac you need to install .Net SDK 2.2.107

I was getting the exact same error as you and finally this has fixed it and I can now compile Forms projects again.