-
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
NUnit Console 3.15.2: Could not load file or assembly 'Microsoft.AspNetCore.Hosting.Abstractions' in WebApplicationFactory #1202
Comments
I see you are using version 3.15.2 of the console runner and engine but are also referencing the NUnit 3 adapter version 4.2.1. That version of the adapter incorporates version 3.13.1 of the engine. This is probably not a problem because the console runner doesn't use the adapter at all, but it might clarify things if you temporarily removed the adapter reference. Alternatively, you could go back to version 3.13.1 of the console runner. |
The same error occurs without the adapter. |
Version 3.13.1 of the runner doesn't support NET 5.0 or NET 6.0 yet, so that doesn't help. |
I believe this is the same issue I posted some days ago... It did take a some days to reach the same conclusion but if you read the last comment I wrote there it explains it, partially. #1208 (comment) The issues seems to be that running the project via You can verify the issue is the same by checking the contents of the environment variable var allTheUsedDepsFiles = System.AppContext.GetData("APP_CONTEXT_DEPS_FILES"); After checking that variable, both running via VS and the nunit console this are the contents:
|
I believe the fix for #1203 will also fix this but I'm leaving this one open pending confirmation. @SuperRembo Can you try the 3.16.0-dev00043 release from our MyGet feed? |
Where can I find that version? I don't see it at https://www.myget.org/feed/nunit/package/nuget/NUnit. There 3.13.4-dev-07602 is the latest 3.x version |
You want the latest version of the NUnit console runner, not the NUnit framework. So, depending on which package you normally use, one of these...
|
With the latest 3.x test runner I get a different error:
The |
What happens if you copy |
When I copy the WebApi.deps.json file from the WebApi output folder to the agent folder (tools/agents/net6.0), then it fails with
|
I've tried a wide range of things on this one but it keeps looking for WebApi.deps.json in the agent folder. I think resolving this might take a detailed examination of the source code for the WebApplicationFactory among other things. I'm marking it as "help wanted" and I'll drop it from the release if necessary. |
Hi,
I have a simple ASP.NET Core web app (source) with an integration test. It's basically a stripped down version of the Microsoft Integration tests in ASP.NET Core example.
With
dotnet test
the test passes, however the NUnit console runner fails with aFileNotFoundException
.Output:
The output directory doesn't contain a
Microsoft.AspNetCore.Hosting.Abstractions.dll
, so apparentlydotnet test
has another way to find it.Is this a bug in the console runner?
Is there a way to tell the console runner where to find the assembly?
Note: There is a Microsoft.AspNetCore.Hosting.Abstractions package, but that hasn't been updated in a couple of years. There is no NET6 version available.
The text was updated successfully, but these errors were encountered: