mvvmgen
mvvmgen copied to clipboard
Attributes often fail
This library often leads to attribute invalidation. You need to manually delete the obj directory and regenerate it to recover
I've also experienced this. Another way to recover is to unload and reload the project.
Hey @wf-soft and @ben-hamida , thank you for the feedback. I assume you can still compile when the attribute is shown as invalid? So, that means, the generator works as expected, but Visual Studio has a few issues with caching.
This seems to be a general issue with C# Source Generators and Visual Studio. I hope that the tooling support will get better with upcoming versions. I keep this issue open, but I don't think that I can influence here anything as a library author.
Maybe it's because there are often problems in some special situations, but it doesn't seem to happen often anymore. The main reason is that the attribute fails occasionally. When there is a bug in the code, it is difficult to find the exception location because it cannot be compiled.
Thanks for the details @wf-soft. I see that finding a bug can be hard if you can't compile. I'll keep this issue open, maybe we find out things we could do in the future to optimize this.
Hey everyone, I close this one, as there's no concrete action to take. I think in the meantime the tooling/Visual Studio also improved. If attributes still fail for you or if you have other problems with the MvvmGen library, please open up a new issue.