Closed AmeerMansour closed 1 year ago
Hey there! We added a new analyzer for this scenario, could you try using our latest preview and checking with that?
Add our preview feed:
https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-MainLatest/nuget/v3/index.json
And then install the lates MVVM Toolkit 8.2.1 preview build you see there. Thank you! 🙂
Still not working ...
I believe there is another issue.
to use it in .net frameworks projects:
I had to add "**<LangVersion>latest</LangVersion>**"
or "**<LangVersion>9.0</LangVersion>**"
to my project then manually add the analyzer
Also code fixer analyzer is not being added to any .net framework project .
So, the analyzers not working are by design, as you're using packages.config
, which is not supported.
But, with 8.2.1 you should be seeing a warning about this. Are you not seeing it?
You should see this warning:
i got no warrning.
You do have the warning, you can see it in the first line:
Thus is by design: packages.config
is not supported. You need to switch to <PackageReference>
to use the generators 🙂
that will be a very big and complicated issue to convert my existing project to use PackageReference some other nuget will fail and will crash my project.
I'm afraid your alternative is just to not use the generators for now then 🥲
To clarify: this is not a limitation with the MVVM Toolkit. The C# compiler (Roslyn) just doesn't support source generators at all for projects using packages.config
, so there's nothing we can do from our end to make our generators work there unfortunately.
Describe the bug
i am trying to use it for a .netframework project but it seems it doesn't add anaylzers.
Steps to reproduce
1.Create wpf project ( .Net framework) 2.Add community toolkit
Expected behavior
Analyzers should be automatically added.
IDE and version
VS 2022
Nuget packages
Nuget package version(s)
8.0.2
Help us help you
Yes, but only if others can assist