-
-
Notifications
You must be signed in to change notification settings - Fork 6
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug 🐞
Build Avalonia project always report CS0246 error. It seems like namespace is not resolved for custom classes. In generated files there are always no using statements for Avalonia namespace and Project.ViewModels namespace.
Step to reproduce
- Create a new Avalonia C# Project, enable ReactiveUI and add this package to the project by nuget
- Open MainView.axaml.cs
- Add
[IViewFor(nameof(MainViewModel))]forMainView - Build, and see error
Reproduction repository
No response
Expected behavior
No build errors
Screenshots 🖼️
IDE
Visual Studio 2022
Operating system
Windows 11 Pro
Version
23H2
Device
Desktop
ReactiveUI Version
18.3.1, by avalonia
Additional information ℹ️
Changing attribute to full declaration like [IViewFor($"ViewModels.{nameof(MainViewModel)}")] can avoid such issue, but StyledProperty and AvaloniaPropertyChangedEventArgs belongs to Avalonia namespace. Please fix this namespace error for Avalonia, and add more information at readme.
Maybe Generic Attribute could help, or scan the full assembly to find the correct class and its namespace. I'm not familar with SourceGenerators.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working

