Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests with different versions of Roslyn #2194

Merged
merged 1 commit into from Oct 23, 2020

Conversation

siegfriedpammer
Copy link
Member

@siegfriedpammer siegfriedpammer commented Oct 21, 2020

Fixes #2141 by downloading precompiled Roslyn compiler packages from https://www.nuget.org/packages/Microsoft.Net.Compilers. Note: these packages are marked as deprecated, we will have to switch to Microsoft.Net.Compilers.Toolset packages for newer versions of Roslyn.

Options we considered:

  1. adding a separate tests project for each version of Roslyn we want to test with - con: increased complexity of our build is a problem
  2. downloading different versions of Microsoft.CodeAnalysis.* packages and creating AppDomains (i.e. AssemblyLoadContext) for each version - con: Reflection and dynamic code is very awkward to work with. It would be necessary to create wrappers/copy enums to our code, etc.
  3. using precompiled csc/vbc from Microsoft.Net.Compilers(.Toolset) packages - pro: simple command line invocation just as we do with mcs already; con: slower than directly invoking Roslyn APIs; this was solved by using the undocumented /shared switch, which allows us to use the VBCSCompiler.exe compiler server.

@@ -191,7 +191,7 @@ private class Change : IChange
public event EventHandler AutomaticEventWithInitializer = delegate {
};

#if ROSLYN
#if CS73
Copy link
Member

@dgrunwald dgrunwald Oct 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the tuple needs CS70; but the dynamic test only needs roslyn?

@siegfriedpammer siegfriedpammer merged commit f836fab into master Oct 23, 2020
@siegfriedpammer siegfriedpammer deleted the multi-roslyn-tests branch October 23, 2020 19:38
ElektroKill added a commit to dnSpyEx/ILSpy that referenced this pull request Aug 10, 2021
Run tests with different versions of Roslyn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testing with Multiple Versions of Roslyn
2 participants