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

Use AssemblyLoadContext to correctly load .NET Core assemblies #781

Merged
merged 2 commits into from
Jun 26, 2020

Conversation

ChrisMaddock
Copy link
Member

@ChrisMaddock ChrisMaddock commented Jun 1, 2020

I believe this fixes #710. It uses .NET Core's AssemblyLoadContext API's to ensure .NET Core dependencies are loaded in the intended way. (It also means that we no longer need to publish as test assembly, to be able to run tests on it.)

This is based on top of #778, so only the last commit is actually new here: 45769e2

Note this will currently fail CI due to #779. (I believe this is actually running the tests correctly now, and exposing test errors which need to be fixed!)

@beloquintana @CharliePoole @schrufygroovy - once we've got CI fixed up, would you be able to test this package with your respective runners, and check it solves the problems you were seeing? I'll shout when it's ready. 🙂

@ChrisMaddock ChrisMaddock changed the title Use AssemblyLoadContext to correctly load .NET Core assemblies [WIP] Use AssemblyLoadContext to correctly load .NET Core assemblies Jun 1, 2020
@ChrisMaddock ChrisMaddock marked this pull request as draft June 1, 2020 19:17
@ChrisMaddock ChrisMaddock changed the title [WIP] Use AssemblyLoadContext to correctly load .NET Core assemblies Use AssemblyLoadContext to correctly load .NET Core assemblies Jun 1, 2020
@ChrisMaddock
Copy link
Member Author

Ok - I've made more progress with this, but will have to come back to it another day. There are two outstanding causes of Test Failures:

  1. XmlTransformResultWriterTests - throws a null reference exception, I expect when the test tries to initialise another engine inside the engine. Unsurprisingly, this isn't actually necessary to test the XML transform functionality - I'll look at refactoring that.

  2. MasterTestRunnerTests - duplicate test ID's with a project and two mock assemblys. This one's a little more concerning - although I'm really not sure why it's only that specific case which is failing. Need to look more closely into that one.

@ChrisMaddock
Copy link
Member Author

Diagnosis: both the above problems are unrelated issues - I believe this is now the correct solution. I'll come back and rebase this functionality once the three other dependent PRs have been merged. 😄

@ChrisMaddock ChrisMaddock marked this pull request as ready for review June 21, 2020 14:10
@ChrisMaddock
Copy link
Member Author

This has now been rebased, and is ready for review.

@beloquintana @CharliePoole @schrufygroovy You should be able to download a NuGet package containing this build from the link below - I'd appreciate if you could test it, and confirm it solves your issues. I also plan to release this as a beta release on NuGet within the next few days.
https://ci.appveyor.com/project/CharliePoole/nunit-console/builds/33647940/artifacts

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.

.NET Core engine only works when located in same directory as test assembly
1 participant