mvvmgen icon indicating copy to clipboard operation
mvvmgen copied to clipboard

Attributes often fail

Open wf-soft opened this issue 3 years ago • 4 comments

This library often leads to attribute invalidation. You need to manually delete the obj directory and regenerate it to recover

wf-soft avatar Feb 24 '22 15:02 wf-soft

I've also experienced this. Another way to recover is to unload and reload the project.

ben-hamida avatar Mar 03 '22 14:03 ben-hamida

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.

thomasclaudiushuber avatar Mar 10 '22 15:03 thomasclaudiushuber

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.

wf-soft avatar Mar 10 '22 15:03 wf-soft

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.

thomasclaudiushuber avatar Mar 11 '22 09:03 thomasclaudiushuber

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.

thomasclaudiushuber avatar Mar 26 '23 17:03 thomasclaudiushuber