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 | firefly 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
333fred3mo 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 User3mo ago
Message Not Public
Sign In & Join Server To View
say | firefly fanatics
Okay thank you, but what does it mean by "does not persist changes"? Yea
333fred
333fred3mo ago
It's adhoc. It knows nothing about the file system It can't save anything you do with TryApplyChanges
say | firefly fanatics
So it cannot write to file basically?
333fred
333fred3mo ago
Think of Stream; you have Adhoc, which is a memorystream, and something like msbuild, which is a filestream
say | firefly fanatics
So i can make changes to adhoc, but it wont save the changes to the file?
reflectronic
reflectronic3mo ago
there is no file in the first place
say | firefly fanatics
Oh i see, okay thank you
reflectronic
reflectronic3mo ago
it is just an in-memory thing
say | firefly fanatics
Okay i got the idea now, thanks
Want results from more Discord servers?
Add your server