You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.
Error AXN0002 System.ArgumentException: The hintName 'View.g.cs' of the added source file must be unique within a generator.
Parameter name: hintName
at Microsoft.CodeAnalysis.AdditionalSourcesCollection.Add(String hintName, SourceText source)
at Avalonia.NameGenerator.AvaloniaNameSourceGenerator.Execute(GeneratorExecutionContext context)
let code = _code.GenerateCode(view.ClassName, view.Namespace, view.XamlType, names)
let fileName =$"{view.ClassName}.g.cs"
selectnew GeneratedPartialClass(fileName, code);
Would it be possible to include the full namespace in the generated source file name, ie FooPage.View.g.cs vs BarPage.View.g.cs? This should guarantee uniqueness.
The text was updated successfully, but these errors were encountered:
I'm using a slightly unusual file organization for my UI with:
However, this fails to compile with:
This is a limitation of Microsoft.CodeAnalysis.GeneratorExecutionContext.AddSource hit by this code:
Avalonia.NameGenerator/src/Avalonia.NameGenerator/Generator/AvaloniaNameGenerator.cs
Lines 43 to 48 in cb79cd8
Would it be possible to include the full namespace in the generated source file name, ie
FooPage.View.g.cs
vsBarPage.View.g.cs
? This should guarantee uniqueness.The text was updated successfully, but these errors were encountered: