Search code examples
c#.netroslyn.net-standard.net-standard-2.0

Can I use Roslyn in .net standard 2.0?


Can I use Roslyn in .Net standard 2.0? Nuget package Microsoft.CodeAnalysis.CSharp is only for .Net Framework. Are there any other ways?


Solution

  • Look at the second point under Details section on github announcement. Personally, I already tried referencing v2.3.0 analyzer assemblies in netstandard 2.0 library and it worked (though admittedly I run it on full framework in the end).

    Try it and you will see if it works in your case. If not, wait for official support or raise an issue.