Roslyn version for .NET Standard 🚧#1
Open
atifaziz wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR builds on top of PR KvanTTT#45 from @codeFather2 and updates the library to target .NET Standard 2.0 and tests to target .NET Core 2.1. While I realize that KvanTTT#45 is work-in-progress, I wanted to share my results and findings in case we'd like to get this merged.
Why do this?
Because there is no reason to limit the library to .NET Framework.
Summary of changes
The GUI was upgraded from .NET Framework 4.6 to 4.6.1 to neatly align with .NET Standard 2.0.
The biggest change needed was in the
CompileUtilsclass that relied onSystem.CodeDomfor compilation, but which is unsupported for now (see dotnet/corefx#12180). So what I did, instead, was to emulate some of the types to have the least impact on the rest of the code and instead spawncsc.exefor the real work. ItsCanCompileandCompilemethods were then changed to take an additional parameter that's the path to the C# compiler executable. I've also added a small batch to the root of the project calledinstall.cmdthat will download the compiler via the Microsoft.Net.Compilers package. If someone clones the repo, they have to runinstall.cmd. This can be improved to happen automagically if need be. However, I feel thatCompileUtilsshould be moved out of the library project and into common code shared by the GUI and the test project that really use it.