-
Notifications
You must be signed in to change notification settings - Fork 106
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.ArgumentException: Unknown framework version 7.0 #987
Comments
@jakubch1 The adapter uses the Nunit engine that comes from the nunit-console project, so I'm moving it there. The issue you linked to is fixed in version 4.0 of the engine, but this has not been released yet, and when it has been released, then the adapter needs to be updated to use the new engine. Have you tried the suggestion in nunit/nunit-console#1176 (comment) ? |
nunit/nunit-console#1176 (comment) is not working for us. |
@jakubch1 I'll get out a pre-release version with the 4.0 dev version of the engine during the weekend. |
In multi target Click to show the error details!
Demo Project to show the issue |
@moh-hassan 1. This is not the net 7 issue, is it ? 2. Testing your repro, it all works on my machine, both in VS2022 and with dotnet test. |
@OsirisTerje thanks for new version. Unfortunately, it is still not working (for .NET Framework). Old error is gone but I see in logs:
|
yes, It's FullFramework issue, .NET45 up to .NET48 The error is I used global.json to control dotnet and it has no effect. I have the next sdk versions installed including net7 preview5
The error is the same, either using vs 2022 v 17.2.5 or using dotnet test. |
@OsirisTerje |
@jakubch1 Yes, I do see the same error here. I've added @moh-hassan 's repro above to the repro repository, and updated with the new package, so you can test it with the code here: https://github.com/nunit/nunit3-vs-adapter.issues/tree/master/Issue987/MyProject.Test The dump file from the discovery looks like this <?xml version="1.0" encoding="utf-8"?>
<NUnitXml>
<test-run id='0' runstate='Runnable' testcasecount='1' result='Failed' label='Error' total='1' passed='0' failed='1' warnings='0' inconclusive='0' skipped='0' asserts='0'>
<test-suite type='Assembly' id='0' name='' fullname='' runstate='NotRunnable' testcasecount='1' result='Failed' label='Error' start-time='2022-06-27 14:30:13Z' end-time='2022-06-27 14:30:13Z' duration='0.001' total='1' passed='0' failed='1' inconclusive='0' skipped='0' asserts='0'>
<failure>
<message><![CDATA[System.ComponentModel.Win32Exception : The system cannot find the file specified]]></message>
<stack-trace><![CDATA[--Win32Exception
The system cannot find the file specified
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at NUnit.Engine.Services.TestAgency.GetAgent(TestPackage package)
at NUnit.Engine.Runners.ProcessRunner.CreateAgentAndRunnerIfNeeded()
at NUnit.Engine.Runners.ProcessRunner.Explore(TestFilter filter)
]]></stack-trace>
</failure>
</test-suite>
</test-run>
</NUnitXml>
```
@CharliePoole Name and Fullname is not there, so is the error related to that? |
@jakubch1 @moh-hassan I found the missing link in the engine, and have uploaded a new adapter package https://www.nuget.org/packages/NUnit3TestAdapter/4.3.0-alpha-net7.4 The Issue project above now works: Please verify this with your solutions. @CharliePoole I'll upload a PR to the console/engine project rsn. |
This fix was based on the master branch, which is back on 3.13, .... it works, but I have to do the same for the latest codebase. The trunk is now called main for the engine project...... So much for that change ....... |
@OsirisTerje Also, It's working fine using CLI Click to show dotnet test!
|
|
Sorry to be late for the party. Since I don't work on the adapter any longer, I don't usually see issues that arise. Also, I'm on vacation. :-) The engine does not yet support tests, which target .NET 7, but that does not seem to be the issue here. It is supposed to run .NET 5.0 tests successfully, even if the only version installed is 7.0. However, in order to run at all, the engine needs to find out what runtimes are installed on the machine. It does that before it even tries to load your tests, by looking at the names of install directories. We have had problems in the past with preview releases creating directories with odd names. This was fixed in 3.15, by ignoring directories, whose names did not have the form of a version number. If you only have a preview release with a non-standard directory name, then the engine will think you have no runtimes capable of handling .NET 5 or .NET 6 as well. OTOH if you have (for example) .NET 6 installed instead, it should work. Currently, I test possible engine problems using a sequence like this...
|
@OsirisTerje Can you briefly summarize the status of this from your point of view? Do you have a private build based on 3.15? Do you want to do a PR? Or if it's a small change, I can just copy it. I had not planned to do any releases after 3.15, because I thought 4.0 would be quicker than it has turned out to be. Do you think we should somehow be coordinating releases? We'd have to decide exactly how... For example. do you only depend on final version releases of the engine? Do we use a set of acceptance tests for the adapter, which are known to pass with the older version of the engine? Other stuff? |
One final note for those testing issues like this one: Make sure you are not referencing two versions of the engine! If you reference both the console runner and the adapter, you must know which versions of the engine each of them uses because one of the two will "win" and be used by both runners. I wrote a post about this quite a long time ago, but it may not be up to date. Maybe this info could be included in the adapter documentation and kept up to date. See http://charliepoole.org/technical/nunit-engine-version-conflicts-in-visual-studio.html |
|
A few comments using your numbering for clarity... 1 and 2. The same fix is present in PR 1175, which was merged on March 23. This is of course subsequent to the 3.15 release, so it has never actually been released.
I'll create an issue to backport the fix in PR 1175 to 3.15.1. |
FYI - I created a release-3.15.1 branch of the console and engine, based on the 3.15 release. |
The 3.15.1-dev00003 release on MyGet should handle this problem. |
@OsirisTerje Are you adding info to the docs about the engine version in use for new releases? |
Yes, I will do that. Might perhaps also add a table in the docs for this, could be helpful going forward. |
Some info is collected in my old blog post on charliepoole.org. |
Right! That table should be in the adapter docs, which would make it easier to maintain it, or I can point to that blog if you can update it ? |
Probably better to take over the info. I'll do a final update to that post pointing to your copy. |
@jakubch1 Version 4.3.0 with .net 7 support is released now |
@OsirisTerje So does the fact that you are running in-process allow .NET 7.0 tests to actually execute under 4.3.0? If so, that's a big advantage to letting VS set up the process being used to run tests. In any case, the 3.16 engine will have an agent for 7.0 but the proliferation of agents is getting a bit out of hand. :-( |
@CharliePoole Yes, it works fine with .net 7 both inside VS 2022 version 17.4 and from dotnet cmd line. |
Is this fixed? We are starting to see this error as machines get upgraded to dotnet7.0. Our test project is on .net framework 4.7.2. |
@OsirisTerje I think I'll be doing a beta release of the 3.16 engine within a few days, in case you want to wait for that. |
@CharliePoole Yes, think that will be wise. |
I think it is better to follow the advice in documentation::)
Nunit is working fine using NUnit3TestAdapter v4.3.0 in net7 and old frameworks. |
@moh-hassan Thanks for the confirmation! |
Upgrade NUnit3TestAdapter to 4.3.1 and the tests should work |
Fix "System.ArgumentException: Unknown framework version 7.0" in step Test (net462) Reference: nunit/nunit3-vs-adapter#987
* Update IronPythonTest.csproj Fix "System.ArgumentException: Unknown framework version 7.0" in step Test (net462) Reference: nunit/nunit3-vs-adapter#987 * Update IronPythonTest.csproj NUnit3TestAdapter 4.3.1 dropped netcoreapp2.1
This should fix issues like nunit/nunit3-vs-adapter#987
This should fix issues like nunit/nunit3-vs-adapter#987
Hello,
I'm getting System.ArgumentException: Unknown framework version 7.0 when trying to use nunit on .net framework project:
This is probably related to nunit/nunit-console#1176 but I'm using vstest.console and adapter.
I'm using:
The text was updated successfully, but these errors were encountered: