TameRoslyn 1.0.2

The mutable wrapper of Microsoft's .NET Compiler Platform ("Roslyn") syntax tree. For simple manipulation of C# files.

Install-Package TameRoslyn -Version 1.0.2
dotnet add package TameRoslyn --version 1.0.2
<PackageReference Include="TameRoslyn" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TameRoslyn --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

TameRoslyn

The mutable wrapper of Microsoft's .NET Compiler Platform ("Roslyn") syntax tree. For simple manipulation of C# files.
Adding .ConfigureAwait(false) example:

var cu = TameCompilationUnitSyntax.FromFile(file);
var items = cu.DescendantsAll().OfType<TameAwaitExpressionSyntax>().ToArray();
for (int i = 0; i < items.Length; i++)
{
var item = items[i];
if (!item.Source.EndsWith(".ConfigureAwait(false)"))
{
item.ReplaceNode(item.Source + ".ConfigureAwait(false)");
}
}
var newSource = cu.Source;
File.WriteAllText(file, newSource);

TameRoslyn

The mutable wrapper of Microsoft's .NET Compiler Platform ("Roslyn") syntax tree. For simple manipulation of C# files.
Adding .ConfigureAwait(false) example:

var cu = TameCompilationUnitSyntax.FromFile(file);
var items = cu.DescendantsAll().OfType<TameAwaitExpressionSyntax>().ToArray();
for (int i = 0; i < items.Length; i++)
{
var item = items[i];
if (!item.Source.EndsWith(".ConfigureAwait(false)"))
{
item.ReplaceNode(item.Source + ".ConfigureAwait(false)");
}
}
var newSource = cu.Source;
File.WriteAllText(file, newSource);

Release Notes

Initial release.

Version History

Version Downloads Last updated
1.0.2 247 10/26/2017
1.0.1 207 5/14/2017