-
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
nunit3-console doesn't see nugets from Microsoft.AspNetCore.App #1392
Comments
Hi! We do have issues with this kind of loading behavior, and we do have multiple attempts at finding the reason. We do have multiple similar errors in the console repo, see https://github.com/nunit/nunit-console/issues I'll move this issue over to that repo. You can have a look at #1383 which is a similar reported issue. See this comment:
If you use the latest test.sdk, you should also get the runtimeconfig.json correct, and then you should get the same error as I have above. See the repro for details. The failure with loading Microsoft.Extensions.Logging.Abstractions is a bit weird. It is a framework reference, and you see it in the dependencies list in Visual Studio, but the console runner doesn't find it. We have to dig a bit deeper to see what this can be. Is there a reason you can't use |
Using "nunit-console3" to run unit tests for .NET 8.0 assemblies that require the "Microsoft.AspNetCore.App" framework fails with the following error:
The workaround was to change the nunit3-comsole.runtimeconfig.json in the net8.0 folder to:
I would rather not have to modify the distribution of nunit3-console to make this work if possible, is there another solution I have missed for this? As an aside, I am unable to use |
@Harmyder I added your load test to our existing package (integration) test for AspNETCore. All tests continue to pass in main. Can you try the same test using the latest dev build from our MyGet feed? The |
@bthharper Your comment is a bit general and may call for a separate issue with more specific info. However, I'd suggest you also try the latest build on MyGet to see if it works. I agree that modifying the runtime config for the console or agents is not satisfactory. It's also not possible for us to do it, since that would mean that nobody could use the console runner unless they had all those frameworks referenced installed, which is not always the case in certain test situations. BTW, since you fixed your problem by changing the runtime config for the console itself, I deduce that you are using the .NET Core version of the runner rather than the standard runner. If you file an issue, please be sure to specify that to avoid confusion. I'm afraid you can't rely on me to remember it, as I'm pretty much stateless when working bugs. :-) |
@CharliePoole - thanks for replying, I can raise a separate issue if that would help. To clarify, I unit testing .NET 8 (so .NET Core) assemblies against I will try the latest build and see if that helps. |
@Harmyder |
I have the following project and test
I can run fine this project from Visual Studio but then I run it from command line with
nunit3-console nunittests.dll
I see the following errorIf I use
Assembly.LoadFrom
with the full path it is able to load the DLL.The text was updated successfully, but these errors were encountered: