Rider 2021.2.2 and Unity 2021.2.5f1

Ran into two issues trying to use the Standalone NUnit Launcher.

First, got an error message that language level 9.0 was not supported. Was able to get past this by adding a Directory.Build.props file that (via xml) specified LangVersion latest.

Now, I'm getting the error below. Can't figure out a way around, blocking me from getting any further.

Any ideas?


System.BadImageFormatException : Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or o...

System.BadImageFormatException : Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)
----> System.BadImageFormatException : Cannot load a reference assembly for execution.
at com.inkwell.BasicDataTests.InsertCheck()

3 comments
Comment actions Permalink

FWIW switching to Unity - Edit Mode and all the tests work fine.

0
Comment actions Permalink

Hello William,

Could you please share a sample using which we could reproduce it, as well as the logs collected via Help | Collect Logs right after issue is reproduced and attach it with a new issue on our tracker? Thank you in advance!

0
Comment actions Permalink

Hey, so I wound up doing a bunch of digging and I think I found the source of the issue. Was able to generate a nice small project that could replicate.

https://youtrack.jetbrains.com/issue/RIDER-73925

Looks like it's some kind of strange issue relating to having a couple of different assembly definition files and then trying to load a 64-bit native library. It's very interesting, the error only appears when running the code in the Standalone NUnit Runner in Rider, not in the Unity Test Runner or in Rider when I run via Unity Edit Mode. Only on Windows, doesn't show up on macOS.

Crossed fingers! Let me know if you have any other questions or need anything else from me to resolve.

0

Please sign in to leave a comment.