Visual Studio doesn't work as expected with source generators [Answered]
I wanted to give source generators a try, i followed Microsoft tutorial and everything worked as expected, but than i changed some things, and the code works as i expected, but visual studio is apparently still thinking i am using the old implementation and gives me errors, but when i actually run it, it works just fine.
10 Replies
Restart VS
Orannis#3333
Restart VS
Quoted by
<@!190858129188192257> from #roslyn (click here)
React with ❌ to remove this embed.
Discussion link here about it
From what i can tell in the discussion, the "reload quickly without restart with project reference" is not really a prioritized scenario so you have to restart to use it
Cc @Orannis feel free to correct me on that
thanks vs reload works
but thats really not what i would like the users to do as i am trying to create an library and the source generated output will differ a lot scenario to scenario
Are your users modifying the generator itself?
If you read the thread i think the discussion is pretty clear about the ergonomics of what you can and can't do
ok i will read thru it
ok this looks bad
i am going to try create a wrapper for python (and possibly other languages too) to use in c#, so the output is going to depend on the provided python files
if i understand the discussion correctly, that will be a problem?
Honestly, i bailed on source gens a while back when i got to the "have to restart" part. So I'm not super knowledgeable here 😅
I'd recommend dropping your use case question in the #roslyn channel and seeing what they say about it
No?
Is the user going to be constantly editing the generator?
If not (and they're not), reloading isn't an issue
ah ok than thanks
✅ This post has been marked as answered!