Error in source code generator when referencing Xamarin.Forms views

John Hair 371 Reputation points
2021-10-02T11:19:38.05+00:00

Hi there,
Im trying to write a simple source code generator (based on ISourceGenerator) which works for simple examples, but as soon as I reference any of the views in Xamarin.Forms it doesn't build.

From some debugging I think it is throwing an error:
Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

The source generator project has the latest Xamarin.Forms nuget, as does the client console project.

Any ideas?

Thanks
John

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,324 questions
{count} votes