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

Assembies are loaded incorrecty #1361

Open
kemsky opened this issue Sep 1, 2023 · 7 comments
Open

Assembies are loaded incorrecty #1361

kemsky opened this issue Sep 1, 2023 · 7 comments
Labels

Comments

@kemsky
Copy link

kemsky commented Sep 1, 2023

I got many random issues trying to run tests using console runner, but finally I found a reason.

Basically, bin folder contains blank dll ("\bin\Debug\net7.0\Microsoft.Data.SqlClient.dll"), which should be resolved to a more specific dll in the runtime folder (something like "bin\Debug\net7.0\runtimes\win\lib\net6.0\Microsoft.Data.SqlClient.dll") but it does not happen.

See full discussion here: dotnet/SqlClient#2064, there is a detailed explanation.

There are many many other cases like this.

This is sample repo: https://github.com/kemsky/nunit-bug

@OsirisTerje
Copy link
Member

OsirisTerje commented Oct 16, 2023

@kemsky Sorry for responding late on this. We have several of the same issues.
Which version of the console are you using?

@kemsky
Copy link
Author

kemsky commented Oct 16, 2023

@OsirisTerje, I've provided sample repo, there you can find all version information.

@OsirisTerje
Copy link
Member

    <PackageReference Include="NUnit.ConsoleRunner" Version="3.16.3" GeneratePathProperty="true" />
    <PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />

You're using both these together, they don't match. See information in docs.nunit.org, under the adapter.

@manfred-brands
Copy link
Member

@kemsky I cloned your repo and cannot reproduce an error. Both dotnet test and dotnet msbuild -t:RunTests run fine.

I also do see the runtimes folder under bin.

@kemsky
Copy link
Author

kemsky commented Oct 17, 2023

@manfred-brands, it seems that some lower level dependency has been upgraded since I originally posted this bug which was 1,5 months ago. I can no longer reproduce it using original sample, but full test suite still fails with the same kind of errors.

dotnet-trace collect --providers Microsoft-Windows-DotNETRuntime:4 shows that different assemblies are loaded, it loads Microsoft.Extensions.Caching.Memory from program files/dotnet/shared/asp instead of local version in the bin folder when I use standalone runnner 3.16.3, when I use runner from package (also 3.16.3) it suddenly can't load System.Collections.Immutable.

dotnet test --no-build works on the very same binaries.

So problem is still there, but there is no way to reproduce it easily.

@OsirisTerje, I removed NUnit3TestAdapter - makes zero difference.

@kemsky
Copy link
Author

kemsky commented Oct 17, 2023

@manfred-brands, original sample still fails when you use standalone runner:

NUnit Console 3.16.0 (Release)
Copyright (c) 2022 Charlie Poole, Rob Prouse
17 october 2023  15:13:32

@CharliePoole
Copy link
Collaborator

@kemsky Not clear which standalone runner you are using. There are, unfortunately, two different runners which display the same header information. What package did you install?

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

No branches or pull requests

4 participants