-
Notifications
You must be signed in to change notification settings - Fork 152
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
Unable to load DLL 'wpfgfx_cor3.dll' or one of its dependencies - when run through nunit console (.NET6) #1319
Comments
@nickkfwong Re the last point... You can't run a .NET 6.0 test in-process because the console process is running under the .NET Framework. |
I see understood - I just tried to list out as the template says that might be helpful for troubleshoot. Indeed, I had tried various options I can see from the help menu, but seems none of them can twist the behavior to workaround the problem ;-( |
you can try to change nunit-agent.runtimeconfig.json for net6 agent as following: { |
Oh my god! This indeed fixes the problem in my test project. I will further check the same in my actual bigger project. Big thanks @svg2003 for pointing this out! Meanwhile, since this comes with the nuget package, what will be the general strategy to have such a modified runtime config to be used in a CI setup? (For this test project I use project specified package path for easier path reference. But usually we use the global path. I believe I should not expect myself to modify anything inside the packages folder?) Also curious if that is a known framework behavior (or is it a nunit console behavior?)...since some other desktop dlls like PresentationCore can be picked up without issue..? (or they do have issue?) |
Sorry, but I have no idea how it supposed to be. I recently switched huge project from net472 to net6, so it's just one of my observations and workarounds. We're using static files during the build, for such things like test runners, so it works for us, albeit, certainly, I'd prefer don't touch official package and pass runtime config explicitly |
@svg2003 Thank you for the advice! |
From what I know, there is no such option right now. I'd expect something like --runtimeConfig parameter for nunit-console.exe that would be passed to agent. |
BTW - when I look into the runtime config of my test project, it is something like this:
Does it mean it would be better to have the agent having the same config also? |
For you it's probably has no sense, if you're going to use windows anyway. |
@nickkfwong In an earlier release of the engine (1 or 2 releases ago) I did something similar to what you suggest. It created a bug where tests could not be run on a machine without windows forms installed. So any change to the agent runtime config has to allow for that use case, which happens in embedded applications. |
Btw, @CharliePoole , are you OK if I will add --runtimeconfig and --depsfile option for console runner, so it could forward it to agent? |
@svg2003 @CharliePoole Understood - thanks for all the advices. I will take @svg2003 's workaround to proceed my migration project for now ;-p Happy to help out if there is anything needed. |
Close for now after clarification. |
Hello,
Previously I have raised this issue to the wpf team, regarding running wpf tests on nunit console. (since initially i think it was kind of related to framework dll loading)
But after some thought, since
dotnet test <test.dll>
worksbut
nunit3-console.exe <test.dll>
does not,I started to suspect it might also be some hidden issue in the console itself rather than the framework itself?
(as dotnet test still relies on the core nunit engine, which prove the engine itself is not a problem?)
I have included all the info I have investigated so far, and a sample project in that issue .
Meanwhile, may I see if anyone might have faced this/have some insight on this issue?
Many thanks for your time.
Note:
The text was updated successfully, but these errors were encountered: