Closed a-jaeger closed 7 years ago
After deleting everything in the solution I found out, that one or more projects directly referenced a nunit.framwerk.dll with version 3.2.1. Using the latest nuget package of nunit in all projects resolved the problem.
@OsirisTerje Is this a bug? It shouldn't matter if the two assemblies containing the base and derived fixture classes reference different versions of NUnit.Framework, should it?
@jnm2 Normally it should not matter. I am pretty sure I have had this case, not with 3.2.1 necessarily, and with different tests, and have had no issues with that.
But as you say in this case the classes inherit each other, so that makes it a bit more special. I am not quite sure what we should expect in this case. Note they only compile against different versions, and thus different assemblies, but runs against one of them. I wonder if this is related to the other issue we have with inheriting from generic classes in different assembles, but I thought that one was resolved. I'll have a closer look at this one.
@OsirisTerje I don't think this is particular to the adapter. We have routinely received questions about mixing framework versions over the years and the answer is always that it is not possible.
Using two different assemblies will allow you to compile but at runtime only one framework can be loaded. The assembly that references the other version causes an exception.
The user should change the code so both assemblies use the same framework version. If the base assembly is out of the user's control - e.g. a third party assembly - then the derived classes must use it's framework version.
It's also possible to deal with this through assembly bindings.
@CharliePoole Thanks, Charlie, that confirms it.
It's a pleasure to see, that you even take self closed issues to enhance nunit. This is very professional. Thanks very much.
I have a TestFixture that inherits from a generic TestFixture in an other assembly. Until there is no Test in the generic base fixture, everything works fine. But when I add a Test to the base fixture, NUnit gives the following output:
The result is, that NO test at all is detected by NUnit in the assembly, where the inherited test fixture class is located.
The code looks like this:
In the other assembly:
If I comment the attribute
[Test]
of the methodShouldSerializeRight_ByDefault_ReturnsFalse
, everything works fine. All tests of the Integration.GeoMan.Green.Tests assembly are recognised and executed. I have tried to find a minimum example. But for now I was not able to reduce my problem. How can I provide you with with mor information?Im am Using NUnit3TestAdapter 3.7.0.0 and Visual Studio Enterprise 2015, Update 3 (14.0.25431.01). My solution is .net Framework 4.5.