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
Manually add code to the app that depends on code generated by the source generator in order to compile correctly, e.g. by implementing an interface like INotifyPropertyChanged, as shown in the Source Generators Cookbook examples.
Compile the project.
Expected Behavior:
The source generator adds code to the compilation and the build succeeds.
Actual Behavior:
The build emits error messages due to missing code that the source generator was supposed to generate, but didn't.
The build will succeed though if the following, not used 'local' namespace declaration is removed from app.xaml: xmlns:local="clr-namespace:NameOfWpfApp"
The behavior is the same for these flavors of .NET used by the test app: .NET Core 3.1, .NET 5, .NET Framework 4.7.2.
The text was updated successfully, but these errors were encountered:
dev-mano
changed the title
A Source generator should add code to the compilation of a WPF application when one of it's XAML files is declaring an app-local namespace
A Source Generator should add code to the compilation of a WPF application when one of the app's XAML files is declaring an app-local namespace
Nov 29, 2020
I'm not sure why removing the namespace makes it succeed, but I assume it causes the generated XAML code to not reference something it is failing with. This isn't a Roslyn issue, but a WPF one. Closing as a dupe of the above issue.
Versions Used:
VS versions 16.8.2 and 16.9.0 Preview 1.0
Microsoft.CodeAnalysis.Analyzers version 3.3.1
Microsoft.CodeAnalysis.CSharp.Workspaces version 3.8.0
Steps to Reproduce:
Expected Behavior:
The source generator adds code to the compilation and the build succeeds.
Actual Behavior:
The build emits error messages due to missing code that the source generator was supposed to generate, but didn't.
The build will succeed though if the following, not used 'local' namespace declaration is removed from app.xaml:
xmlns:local="clr-namespace:NameOfWpfApp"
The behavior is the same for these flavors of .NET used by the test app: .NET Core 3.1, .NET 5, .NET Framework 4.7.2.
The text was updated successfully, but these errors were encountered: