Hello, I have this weird error since I upgraded to unity 2021.3 (.2f1) from 2020.3.
I have an assembly definition for my tests where I load needed AD and nunitframework.dll
But when I execute my tests I have a System.BadImageFormatException when I look in detail I have
Impossible to load file or assembly ‘netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ or one of its dependencies (Exception HRESULT : 0x80131058).
Do you know what causes this ? I look csproj and found the netstandard reference that correctly points to a dll on my drive.
Thanks in advance if you can point me in the correct direction to solve this.
if I switch the API compatibility Level* from .net Standard 2.1 to .Net framework in my project settings the tests works but I can’t build my application anymore
I think there is a deeper problem regarding Unity+Rider+UnitTesting.
These broke back in late 2020. Standalone NUnit launcher is not properly working since.
I’ve try everything I have found here and there but still cannot make it work back. TDD with Unity Editor Mode is such a cumbersome waiting cycle.
Didn’t work to me because of what you highlighted in the edit. NUnit standalone requires a build, which fails. It says “invalid option 9.0 for /langversion…”. Whatever I try, a new error arises then a new one until I get back to this very first error.
It’s really cumbersome, this regression.
But generally it would work switching to .NET Framework for tests, and switching to .NetStandard for builds? Because we should be able to script that switch when making a build using a rather simple build override script .
I wonder if you have the same issue in Rider, where I cannot select .NetStandard as the target framework for any new project (not just Unity Class Library):