-
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
System.TypeLoadException : Could not load type 'System.Windows.IWeakEventListener' from assembly 'WindowsBase' #1466
Comments
It does seem like here's the same problem, #1383 |
Can you clarify whether you are running the standard console runner or the netcore console runner? Check the "Runtime:" value when you run a program. It will either indicate .NET 6, .NET 8 or .NET Framework. The standard runner (.NET Framework) and the two .NET Core builds have quite different feature sets and should probably not have the same package or executable names. They also can have quite different bugs. :-( |
Sorry charlie I don't get you here.
How to check the "runtime:" value when I run "a program"( which program)?
…On Sat, Aug 31, 2024, 7:54 PM CharliePoole ***@***.***> wrote:
Can you clarify whether you are running the standard console runner or the
netcore console runner? Check the "Runtime:" value when you run a program.
It will either indicate .NET 6, .NET 8 or .NET Framework.
The standard runner (.NET Framework) and the two .NET Core builds have
quite different feature sets and should probably not have the same package
or executable names. They also can have quite different bugs. :-(
—
Reply to this email directly, view it on GitHub
<#1466 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADENIZRXH7G5QDALYTH4TGLZUGVHTAVCNFSM6AAAAABNL534NWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRSHA3TGNZZGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@WindingWinter Sorry... When you run |
FYI see #1467 |
@WindingWinter I wrote about the different console programs here #1467 (comment) If you use If you use the dotnet tool Anyway, this way you can state what runner you're using. If you have installed the dotnet tool in some other manner, I suggest you uninstall that, and install it as a dotnet tool. It makes life easier. :-) PS1: One way people install the console is as a nuget package under the current test project. I never do that since that might interfere with the adapter if you're not careful. PS2: Interesting though, the OS version are reported differently with these two variants of the console. Not sure why. PS3: When using Resharper or Rider, they use an embedded version of the NUnit.Engine. It was version 3.12 some time ago, but I think they have upgraded lately. It is not version 3.18.1 though. |
On my local machine, I get net6.0 / net8.0 depending on which of the netcore versons I run. FYI, prior to 3.18.1, their were two different .NET Core runners being packaged, making things even more confusing. In 3.18.1 I limited it to the .NET 6.0 build - see issue #1449. That has the advantage of running under 6.0, 7.0 or 8.0. Also, the "Runtime:" line in the output shows the runtime under which the console is running, not the runtime for which it was built. So this can vary from machine to machine but will always allow you to distinguish between a .NET Framework version and a .NET Core version. |
So @WindingWinter Which is it for you? :-) |
@CharliePoole , here's my runtime info from the nunit console output file:
And here's my
|
@WindingWinter Ok, so after all those questions, it's just the standard console runner. :-) That means it's possibly a bug in the .NET 8.0 agent or in TestCentric.Agent.Core, which has the agent common code. I'll try to create a repro locally to confirm it. |
Seems related to this issue #1203. So my workaround is that I change the
And now it works! |
Thanks. This will help with finding a solution to the issue. |
Fixed this by reordering how we look for dependencies when the test assembly uses Windows Forms , WPF or Asp .NET Core. In the case of this issue, it allows us to find the proper WindowsBase. |
This issue has been resolved in version 3.18.2 The release is available on: |
This problem happens in nunit console 3.18.1 but not when I run in Resharper test runner.
Here's my main code
And here's my csproject
here's my test code:
And the test csproject
And if I run the test in Resharper test runner, the test passes!
But if I run it in nunit console
And I will get the following error:
Seems like a bug but I don't rule out that it could be some config issue also. What could be the error?
The text was updated successfully, but these errors were encountered: