Error: 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

RR 1 Reputation point
2020-12-27T16:53:42.933+00:00

I working in a solution containing a VB and a C# project. It runs well from Visual Studio (2013)development environment and as an executable in the development PC.

When deployed to another PC I keep getting this error:

"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"

This error occurred when an event is trigger from a vb form to display the c# form.

I modified the configuration for the C# project as follow:

<?xml version="1.0" encoding="utf-8"?>
<configuration>

<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/> sku=".NETFramework,Version=v4.0"/>
</startup></configuration>

Thanks

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,914 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,724 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Karen Payne MVP 35,421 Reputation points
    2020-12-27T18:36:46.577+00:00

    Hello @RR

    You might need to also change sgen.exe.config as per the following Microsoft documentation.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.