We have an old project with .Net Framework 4.5.2 and want to run some unit tests with newer versions of Rider. Test run with Rider 2021.3, but not with Rider 2022.2 and 2022.3
All of them fail with
Test has not run
Last runner error: Could not load file or assembly 'System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Reference assemblies cannot be loaded for execution. (0x80131058) Cannot load a reference assembly for execution.
--- EXCEPTION #1/3 [BadImageFormatException]
Message = “Cannot load a reference assembly for execution.”
ExceptionPath = Root.InnerException.InnerException
ClassName = System.BadImageFormatException
HResult = COR_E_LOADING_REFERENCE_ASSEMBLY=80131058
--- Outer ---
--- EXCEPTION #2/3 [BadImageFormatException]
Message = “Could not load file or assembly 'System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Reference assemblies cannot be loaded for execution. (0x80131058)”
ExceptionPath = Root.InnerException
ClassName = System.BadImageFormatException
InnerException = “Exception #1 at Root.InnerException.InnerException”
HResult = COR_E_LOADING_REFERENCE_ASSEMBLY=80131058
Source = System.ServiceModel
BadImageFormat_FileName = “System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”
StackTraceString = “
at System.ServiceModel.Description.ServiceCredentials..ctor()
at System.ServiceModel.ServiceHostBase..ctor()
at System.ServiceModel.ServiceHost..ctor(Object singletonInstance, Uri[] baseAddresses)
at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.DataCollector.StartLocalDataCollector()
at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.DataCollector.Initialize()
at JetBrains.ReSharper.UnitTesting.MSTest.Provider.New.TestWindow.TestWindowMsTestRunner.StartDataCollector()
at JetBrains.ReSharper.UnitTesting.MSTest.Provider.New.TestWindow.TestWindowMsTestRunner.<Initialize>b__13_0()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread,
....
--- Outer ---
--- EXCEPTION #3/3 [LoggerException]
Message = “Could not load file or assembly 'System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Reference assemblies cannot be loaded for execution. (0x80131058)”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
InnerException = “Exception #2 at Root.InnerException”
HResult = COR_E_APPLICATION=80131600
We`ve tried a lot but without success. Is there any idea?