Replies: 6 comments
-
Hi! I'm struggling to understand the issue here. You also mention including the console runner - that can be scary business, depending on how you install it and what version you include. Can you provide a small repro for this? |
Beta Was this translation helpful? Give feedback.
-
Thanks for taking the time to read the issue. I've attached a small example. I have Mono Running the test program gives the error:
See
My question is, what is the best practice to resolve this error on Linux, that my nunit tests can be tested on Linux using the Mono runtime? |
Beta Was this translation helpful? Give feedback.
-
I am no mono/linux expert, but: |
Beta Was this translation helpful? Give feedback.
-
Yes, I am sure the correct frameworks are installed. The binaries generated targeting .NET 4.x work fine with mono. So can the .Net Core when prefixed with installation of Mono is from the Mono Project, not the default packages provided by Ubuntu 22.04 that they’ve traditionally been buggy. it is only using the VSTest target that i appreciate the links (the GitHub issue appears irrelevant but is quite long) so I’ll investigate them further and experiment. |
Beta Was this translation helpful? Give feedback.
-
I had a further look, and the links posted don't help. They're related to targetting frameworks and builds. There is nothing wrong with the build and it works fine. The only point is that the sample project posted here in test.zip builds, but does not know how run nunit test cases on Linux with Mono installed. As an alternative, I'm looking now into creating my own targets to execute So if anyone knows how to get the Microsoft Test SDK working on modern Ubuntu 22.04 with Mono installed (64-bit only, 6.12.199), that would be helpful. |
Beta Was this translation helpful? Give feedback.
-
Testing last night, with .NET SDK 8.0 from MS on Ubuntu 22.04, it runs the test cases using Mono. So it appears that this was a broken feature in 17.x when .NET 4.0 was removed, and appears to be fixed. Not sure if it's worthwhile to follow up on this any more. |
Beta Was this translation helpful? Give feedback.
-
My Open Source targets frameworks .NET 4.0-.NET 4.8, .NET Standard 2.1. On Windows I use the VSTestAdapter 17.4.0, and recently worked around the fact that .NET 4.6.2 is the lowest version (I build for .NET 4.0, but link with .NET 4.8 and have hacks for that).
When running Under Linux, with Mono, on Ubuntu 22.04, everything builds, but I would like to know what are the best practices for running .NET 4.8 under Mono/Linux. I get errors such as:
or
Any best practices to resolve this?
My test project package references have:
To execute, I run:
I could ignore the .NET framework tests all together with
-f netcoreapp3.1
(note I have to set the env var DOTNET_ROLL_FORWARD=LatestMajor`. but that skips over Mono .NET Framework tests. And this isn't scalable as soon as I start mixing test targets like netcoreapp3.1 and net6.0 (I'm trying to have a common environment for Linux and Windows, development on Windows, test on Linux).I include the console runner, I can run that and execute the tests from within Mono on the target. Does that mean
dotnet test
can't execute that? Is there a suggestion of a target, or changes to my.csproj
files to execute nunit3-console instead of using the VS Test Runner (it's not that great, but needed for testing in VS2019/VS2022).Thank you for your time and a great test framework. My FOSS is at github.com/jcurl/RJCP.base (and all the submodules).
Beta Was this translation helpful? Give feedback.
All reactions