R# 2018.3 causes lots of "System.IO.FileLoadException : Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. " errors.

We have a suite of 10,000 unit tests which ran with no issues prior to the 2018.3 update.  After the update, I have 45 failures with these Mixed mode assembly errors mostly.  I googled this error and found that similar (non-reshaper) issues of this type require adding 

<startup useLegacyV2RuntimeActivationPolicy="true"> </startup>

to app.config files.   I created an app.config file for unit test dll  project causing the majority of these errors and also verified that C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\x64\TE.ProcessHost.Managed.exe.config had this setting in place. None of these changes has made any difference in outcome.

The issues seem to stem from a 3rd party hardware dll that we reference that uses .net 2.5.  I can run Microsoft's Test Explorer with none of these issues.

What can we do to eliminate this problem?

thanks,

Rollan

19 comments
Comment actions Permalink

One other comment- we're using Nunit2 instead of Nunit3 at the moment.

0
Comment actions Permalink

We are using NUnit 3 and are experiencing the same issue.  Is this an issue with our setup or with ReSharper?

0
Comment actions Permalink

Same problem here. We are also using NUnit 2 and NUnit 2 Test Adapter in Visual Studio 2018. The application is dependent on a mixed mode assembly compiled against platform tools version 9. This worked without problems before upgrading Resharper though.

0
Comment actions Permalink

By the way - we can execute tests fine with NUnit 2 Test Adapter...

0
Comment actions Permalink

JetBrains- this is a real issue that came with the most recent upgrade.  Up until 2018.3, it was a no-brainer doing an update when one becomes available. 

 

We need some guidance on what to do since it's impacting multiple companies now.  For the time being, I'm using an ignore test category to skip running the offending tests so the other 9000+ tests can function.

0
Comment actions Permalink

I had enough problems with the unit test engine stopping that I wound up downgrading to 2018.2.3. ALL MY PROBLEMS WENT AWAY!!!

I didn't see anything that looked 'iffy' in the release notes regarding the unit test engine becoming unreliable, but it certainly is in 2018.3.  I'll look forward to the 2018.3.1 update - hopefully the release notes will indicate a fix to the test engine - otherwise I'm not going to upgrade until there's a fix for that. 

0
Comment actions Permalink

I can confirm that downgrading to 2018.2.3 solves the issue. Awaiting fix before upgrading again.

Did anyone file a ticket to get this solved?

1
Comment actions Permalink

I can also confirm that downgrading to 2018.2.3 solves the issue.

0
Comment actions Permalink

Hello everyone.

 

Sorry for delay in responding.

We'd be grateful if anyone could kindly provide us a log by running Visual Studio with the following command line: 'devenv /ReSharper.LogFile C:\resharper_log.txt /ReSharper.LogLevel Verbose'. After VS is been started please reproduce the issue and send us a corresponding 'resharper_log.txt' file. You can do it privately using 'Submit a request' form.

Also some sample solution demonstrating the issue will be highly appreciated.

Thanks in advance.

0
Comment actions Permalink

Hello everyone.

 

Rollan as topic starter stated that “The issues seem to stem from a 3rd party hardware dll that we reference that uses .net 2.5.”
Could you please name the dll that you're using?

If anyone else could share this info we'd be grateful.

Thank you.

0
Comment actions Permalink

I was also just bitten with this bug as I had a reference to Microsoft.Sql.Smo.dll that is built in 3.5 but runs on the 2.0 .Net engine.

The work around is, go to the installation of Resharper at C:\Users[user]\AppData\Local\JetBrains\Installations\ResharperPlatform[version] and create a new file called ReSharperTestRunner64.exe.config (or ReSharperTestRunner32.exe.config) and inside that file add the following:

<?xml version="1.0" encoding="utf-8" ?>
  <configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
      <supportedRuntime version="v4.0.30319"/>
      <supportedRuntime version="v2.0.50727"/>
    </startup>
</configuration>

The tests should now pass. 

1
Comment actions Permalink

@Andy Rudd : In my case I had to create ReSharperTestRunner32.exe.config. But after doing this the tests run as before. Thanks!!!

0
Comment actions Permalink

Adding the .config did not resolve my problem. I've have submitted a log file now Angelina Elycheva.

0
Comment actions Permalink

Hello everyone!

 

Please try the following private build  and let us know if it helps to resolve the problem.

Thanks in advance.

0
Comment actions Permalink

I have tested the supplied private build. 

 

- The .config files mentioned above were already present and contained the useLegacyV2RuntimeActivationPolicy when I started

- Installed the supplied build

- Executed unit tests from VS2017 -> worked fine

- Thought that maybe I should have deleted the .config files so I did so -> now it crashed when running unit tests via Resharper

- Ran the installation again and choose to repair

- Executed unit tests from VS2017 -> worked fine

0
Comment actions Permalink

Thank you for the provided info, Tim.

Glad to know it helped.

Fix will be included in upcoming ReSharper 2018.3.2.

Thank you.

0
Comment actions Permalink

Hi Angelina,

I'm using R# 2018.3.2, but it's not fixed yet. I see a lot BadImageLoadException for the following dlls when running unit test with NUnit2:

  • Hunspellx64.dll
  • Hunspellx32.dll
  • CleanUpProfiler.x64.exe
  • CleanUpProfiler.x32.exe
  • JetLauncher32.exe
  • JetLauncher32c.exe
  • JetLauncher64.exe
  • JetLauncher64c.exe

It doesn't affect the test running but significantly slow down the test running

Thanks

0
Comment actions Permalink

Hello Jeffrey!

 

Thank you for the feedback.

It's different problem, please refer to the corresponding issue reported - https://youtrack.jetbrains.com/issue/RSRP-473433.

Thank you.

0

Please sign in to leave a comment.