-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: namespace error #54
Comments
We will release this update soon, if you wanted to try it you could download the related nuget package from the CI build https://github.com/reactiveui/ReactiveUI.SourceGenerators/actions/runs/11043024970/artifacts/1979778639 Thank you |
Thanks for your quick response! I have tried the latest version and the generic attribute works as expected. But the generated code still lacks namespace I have uploaded minimal project. This project is created step by step, a minimal Avalonia C# Project with And the Generic Attribute tracking issue shows this feature is still in progress, and it won't be backported to .NET Framework. Please evaluate its compatibility. |
I have checked default templates for As a result,
Check the generated code, the ViewModelProperty is defined as Parameter 3 of There are some troubles for default templates for WinUI3(#4693, #4734) and UWP(strange nullable settings), I cannot test these frameworks. Should I open another issue for this? I hope the information can help this project better. |
Thank you very much for this feedback, I will reopen this and re visit the solution. |
Hi, I believe that #65 has now resolved this issue, thank you very much for the pointers to the issues. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
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 andProject.ViewModels
namespace.Step to reproduce
[IViewFor(nameof(MainViewModel))]
forMainView
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, butStyledProperty
andAvaloniaPropertyChangedEventArgs
belongs toAvalonia
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.
The text was updated successfully, but these errors were encountered: