Testura / Testura.Code

Testura.Code is a wrapper around the Roslyn API and used for generation, saving and compiling C# code. It provides methods and helpers to generate classes, methods, statements and expressions.
MIT License
297 stars 30 forks source link

.NETStandard support? #31

Closed zyzyxdev closed 4 years ago

zyzyxdev commented 6 years ago

Hi, I just tried using Testura.Code in a .netstandard1.6 project but I get the following errors:

Package Testura.Code 0.8.0 is not compatible with netstandard1.6 (.NETStandard,Version=v1.6). Package Testura.Code 0.8.0 supports: net452 (.NETFramework,Version=v4.5.2)

and

Detected package version outside of dependency constraint: Microsoft.CodeAnalysis.CSharp.Workspaces 1.3.2 requires Microsoft.CodeAnalysis.CSharp (= 1.3.2) but version Microsoft.CodeAnalysis.CSharp 2.2.0 was resolved. Package Microsoft.Composition 1.0.27 is not compatible with netstandard1.6 (.NETStandard,Version=v1.6). Package Microsoft.Composition 1.0.27 supports: portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)

Did I miss something or is it just not compatible?

weshaggard commented 4 years ago

@MilleBo would you be interested in taking a PR that adds support for .NET Standard 2.0? I have an interest in playing around with this library but I need it to run on .NET Core and as such it should probably be a .NET Standard 2.0 library. I did a quick look and the only thing that isn't supported is the AppDomain stuff you have, so we would either need to remove that or have 2 target frameworks one for .NET 4.7.2. with the AppDomain stuff and one with .NET Standard 2.0 without it. It shouldn't take much effort to convert the project to .NET Standard 2.0 so I'll try to do that in the next few days and submit a PR.

weshaggard commented 4 years ago

PR submitted https://github.com/Testura/Testura.Code/pull/39.

MilleBo commented 4 years ago

I have now merged and published the changes to nuget. So you should be able to update to 0.12.0 soon.