Try Apply Changes(Solution) Method
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Apply changes made to a solution back to the workspace.
The specified solution must be one that originated from this workspace. If it is not, or the workspace has been updated since the solution was obtained from the workspace, then this method returns false. This method will still throw if the solution contains changes that are not supported according to the CanApplyChange(ApplyChangesKind) method.
public: virtual bool TryApplyChanges(Microsoft::CodeAnalysis::Solution ^ newSolution);
public virtual bool TryApplyChanges (Microsoft.CodeAnalysis.Solution newSolution);
abstract member TryApplyChanges : Microsoft.CodeAnalysis.Solution -> bool override this.TryApplyChanges : Microsoft.CodeAnalysis.Solution -> bool
Public Overridable Function TryApplyChanges (newSolution As Solution) As Boolean
Thrown if the solution contains changes not supported according to the CanApplyChange(ApplyChangesKind) method.