Compilation.ReplaceSyntaxTree(SyntaxTree, SyntaxTree) Method

Definition

Creates a new compilation with an old syntax tree replaced with a new syntax tree. Reuses metadata from old compilation object.

public Microsoft.CodeAnalysis.Compilation ReplaceSyntaxTree (Microsoft.CodeAnalysis.SyntaxTree oldTree, Microsoft.CodeAnalysis.SyntaxTree newTree);

Parameters

oldTree
SyntaxTree

The old tree.

newTree
SyntaxTree

The new tree.

Returns

A new compilation.

Applies to