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

NUnit3 Module call to console runner fails with FileLoadException #2600

Closed
pchinery opened this issue Jun 30, 2021 · 8 comments · Fixed by #2690
Closed

NUnit3 Module call to console runner fails with FileLoadException #2600

pchinery opened this issue Jun 30, 2021 · 8 comments · Fixed by #2690
Labels

Comments

@pchinery
Copy link
Contributor

pchinery commented Jun 30, 2021

Description

Suddenly, our NUnit 3 Console runner started to fail with an FileLoadException for nunit.engine.api with the message "Provider DLL failed to initialize correctly" (HRESULT: 0x8009001D).

This most likely happened after an update to dotnet 5.0.301. We had to update MSBuild.StructuredLogger, because the log format had changed. With that being the only change in our dependencies, the error now appears and the code is unchanged otherwise. So the most likely root cause is the dotnet update.

Repro steps

I have created a sample repo which fails on multiple machines with dotnet 5.0.301. It contains two test targets. Both should do the same, but the manual process creation works while the NUnit module fails with the given exeception. The parameter lists are identical and even using a parameter file (like the module does) does not change the result.

Expected behavior

The whole build script should execute successfully and both test targets should run all tests.

Actual behavior

The target Test2 fails with an FileLoadException for nunit.engine.api with the message "Provider DLL failed to initialize correctly" (HRESULT: 0x8009001D).

Known workarounds

Calling NUnit manually (as in Test1) does help (for whatever reason).

@github-actions
Copy link
Contributor

Welcome to the FAKE community! Thank you so much for creating your first issue and therefore improving the project!

@pchinery pchinery changed the title NUnit3 Module fails with FileLoadException NUnit3 Module call to console runner fails with FileLoadException Jun 30, 2021
@thinkbeforecoding
Copy link
Contributor

having the exact same problem. Trying to run the same cmd line in the terminal succeeds.

@yazeedobaid
Copy link
Collaborator

Clone https://github.com/fsharp/FAKE/issues

Can you please provide the URL for the repro repository?

For MSBuild.StructuredLogger we have this PR which handles the update of the structured logger.

Thanks

@pchinery
Copy link
Contributor Author

pchinery commented Jul 5, 2021

Can you please provide the URL for the repro repository?

Sorry, I somehow pasted the wrong URL in the description. I have updated it now and the correct URL is https://github.com/pchinery/nunit-bug-hunt

For MSBuild.StructuredLogger we have this PR which handles the update of the structured logger.

The part with MSBuild.StructuredLogger most likely is not related to this problem. I just wanted to point out that code in our repository suddenly stopped working with no change to the code itself and only the single dependency MSBuild.StructuredLogger being updated.

@rosecodym
Copy link

I'm seeing this too (after an update to .NET 6 in my case).

@michaelsmithson
Copy link

I just started getting this issue as well after upgrading to .NET 6.

For me commenting out the line "CreateProcess.withEnvironment" in the createProcess function here

|> CreateProcess.withEnvironment (parameters.Environment |> Map.toList)
resolved it for me.

I'm not really sure why this was causing the issue as I was just passing an empty list to that function.

@yazeedobaid yazeedobaid mentioned this issue Jul 25, 2022
7 tasks
@yazeedobaid
Copy link
Collaborator

@michaelsmithson Thanks a lot for the hint at that location. It indeed was the cause of the issue.
I have opened PR #2690 which has a possible fix for the issue.
Feedback is highly appreciated.

@yazeedobaid
Copy link
Collaborator

The fix has been released in 5.23.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants