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

Fix "The ... framework is not available. Available frameworks: mono-4.0" #1403

Closed

Conversation

Bartleby2718
Copy link

I think this fixes #1387?

I just copypasted everything from #1256 (git cherry-pick failed me.)

Would it be possible to create an alpha and see if this does fix the issue?

@OsirisTerje
Copy link
Member

OsirisTerje commented May 25, 2024

Have you tried creating a local package ?
build --target package

If that works for you, then I think we can just merge this, and a dev package will be pushed to myget.org

UPDATE: You must also retarget this PR to branch version3X

@Bartleby2718
Copy link
Author

Hmm, interesting.

So this was the code in my appveyor.yml:

nuget install NUnit.Console -Version 3.17.0 -OutputDirectory testrunner -Source https://api.nuget.org/v3/index.json
mono ./testrunner/NUnit.ConsoleRunner.3.17.0/tools/nunit3-console.exe ./MyTests/bin/Release/net462/MyTests.dll

https://github.com/nunit/nunit-console/blob/version3X/nuget/runners/nunit.console-runner.nuspec#L127 says the nunit-console.exe I'm using is coming from the net20 directory, so I thought I should use bin/Release/net20/nunit3-console.exe which was generated after I ran build --target package.

However, even if I use bin/Release/net20/nunit3-console.exe like this:

mono /mnt/c/path/to/my/nunit-console/bin/Release/net20/nunit3-console.exe ./MyTests/bin/Release/net462/MyTests.dll

I'm getting the same error message:

System.ArgumentException : The net-4.6.2 framework is not available.
Available frameworks: mono-4.0
--ArgumentException
The net-4.6.2 framework is not available.
Available frameworks: mono-4.0
  at NUnit.Engine.Services.TestAgency.GetAgent (NUnit.Engine.TestPackage package) [0x0008e] in <98a5d354480145bf8bc83cc74d63f414>:0
  at NUnit.Engine.Runners.ProcessRunner.CreateAgentAndRunnerIfNeeded () [0x0003d] in <98a5d354480145bf8bc83cc74d63f414>:0
  at NUnit.Engine.Runners.ProcessRunner.RunTests (NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x0001f] in <98a5d354480145bf8bc83cc74d63f414>:0

Do you think this is not the right fix, or did I test it incorrectly?

@OsirisTerje
Copy link
Member

Not sure how your repro is, but I normally copy the produced nuget packages into c:\nuget, which I use as my local feed.
In my repro project I have a nugetr.config, which adds that folder as a new feed, I normally call that "local" to make it easy for myself.

In my repro csproj I use the version located at that local feed - and it will be loaded and located correctly.

From what you write above, - I am not sure but - it looks like you still load from nuget.org

@Bartleby2718
Copy link
Author

I think either IsAvailableFramework or Supports in RuntimeFrameworkService should be updated to support this, but I no longer need this because we're dropping support for Mono. Declining the PR. Thanks for the quick engagement @OsirisTerje!

@CharliePoole
Copy link
Member

@Bartleby2718 What is/was your platform when encountering this problem? Depending on what it was, I may want to reopen.

@Bartleby2718
Copy link
Author

@CharliePoole Mono on AppVeyor's Visual Studio 2022 image, so Mono 4.0.2 SR2 per https://www.appveyor.com/docs/windows-images-software/#mono

Target frameworks of the test project: net462, net6.0, net8.0.

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

Successfully merging this pull request may close these issues.

3 participants