Whats the difference between Workspace and AdhocWorkspace?

Im currently trying to learn roslyn api. In Microsoft.CodeAnalysis namespace, there is two classes named AdhocWorkspace and Workspace. Whats the difference between these two? Which one i should use?
12 Replies
say | huohuo fanatics
The only description about AdhocWorkspace in learn.microsoft.com is that it allows full manipulation and does not persist changes, but i have no idea what that mean
333fred
333fred2mo ago
A workspace is an abstraction around a solution An adhocworkspace is a specific implementation, that you manually populate (in an adhoc fashion) Also, #roslyn is the best place to ask these questions
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
say | huohuo fanatics
Okay thank you, but what does it mean by "does not persist changes"? Yea
333fred
333fred2mo ago
It's adhoc. It knows nothing about the file system It can't save anything you do with TryApplyChanges
say | huohuo fanatics
So it cannot write to file basically?
333fred
333fred2mo ago
Think of Stream; you have Adhoc, which is a memorystream, and something like msbuild, which is a filestream
say | huohuo fanatics
So i can make changes to adhoc, but it wont save the changes to the file?
reflectronic
reflectronic2mo ago
there is no file in the first place
say | huohuo fanatics
Oh i see, okay thank you
reflectronic
reflectronic2mo ago
it is just an in-memory thing
say | huohuo fanatics
Okay i got the idea now, thanks
Want results from more Discord servers?
Add your server