Hi @Bhuwan ,
Thanks for reaching out.
I looked at the errors you’re seeing with SourceGen in your MAUI project. The root cause here is that the generated code is trying to call methods like XamlResourceIdAttribute.GetPathForType and ResourceDictionary.RDSourceTypeConverter.GetResourcePath that aren’t available in the version of MAUI or the NuGet packages you currently have. Essentially, the “SourceGen robot” is asking for tools that aren’t in the toolbox yet.
I would suggest a few ways:
- Update MAUI packages - Make sure all your
Microsoft.Maui.*NuGet packages are up to date and matching versions. SourceGen depends on features present in the latest builds. - Check your MAUI version - SourceGen works best with .NET MAUI 10 or later. Older versions can produce code referencing missing methods.
- Clean and rebuild - Delete
binandobjfolders to remove stale generated files, then rebuild the project. - Optional fallback - If updating is tricky, you can temporarily remove or comment out:
Your app will still work, just without the SourceGen optimizations.<MauiXamlInflator>SourceGen</MauiXamlInflator> <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.