cancel
Showing results for 
Search instead for 
Did you mean: 

Dll project : 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.

0 Kudos

Hi I have a dll project in C#.

I try to update his framework from 2 to 4.

Now when I use : SetDataSource, I have the 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.

I try to create an app.config file with:

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

<configuration>

  <startup useLegacyV2RuntimeActivationPolicy="true">

    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

</startup>

  </configuration>

When I compile I have those file : myapp.dll and myapp.dll.config and planning.rpt

I use this dll in an other winform project (dll project is for plugin)

This winform project use also crstal report and I have an app.Config with the supportedRuntime line and there is no problem.

Have you a solution?

Thank you.

Gwenael

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hi Gwena

Not sure if this will make any difference - just going by KBA 1525432 and 1870767. Change

  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

to

  <supportedRuntime version="v4.0"/>

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

0 Kudos

Hi Ludek I already try <supportedRuntime version="v4.0"/> and I still have the problem.

former_member183750
Active Contributor
0 Kudos

What is the version of VS you are using (2010, 2012, 2013)?

What is the version of the CR assemblies referenced in your project?

What is the version of the crpe32.dll in this folder:

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86

- Ludek

0 Kudos

I use VS 2010.

The version of the CR assemblies is : 13.0.2000.0

The version of the crpe32.dll is : 13.0.5.891

former_member183750
Active Contributor
0 Kudos

13.0.5.891 means you are using Service Pack 5. Latest available SP is SP 10. Please see if that helps:

If SP 10 does not help, please attach your config file here.

- Ludek

0 Kudos

The version of crpe32.dll in :

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64 is now 13.0.10.1385

I download the version 32 bit too.

The version of the CR assemblies reference in my projec is still : 13.0.2000.0. Is it normal?

I still have the problem.

My app.config is

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

<configuration>

  <startup useLegacyV2RuntimeActivationPolicy="true">

    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

</startup>

  </configuration>

There is nothing else in the file, I just create it because I have the bug.

I recall you that my VS project create a dll (plugin) with a rpt that is used in an other VS winform project.

The winform use rpt too and the line <supportedRuntime version="v4.0"/> in is app.config work.

I have an other dll project (an other plugin) that use crystal report but the rpt don't use dataset and there is no problem.

But in the case where I have the problem I can not create the rpt without dataset.so I think thaht the problem is that I use a dll project that is used in a winform project.

I attach the text of the config file of my winform project.

former_member183750
Active Contributor
0 Kudos

Referencing:


I recall you that my VS project create a dll (plugin) with a rpt that is used in an other VS winform project.

What happens if you create a config file for that project?

What happens if you create a new simple test project that just displays the report. E.g.; without going to another winform project?

- Ludek

0 Kudos

Hi,

I already create a config file for the dll project and the winform project.

The config file for dll project is that I post in my first message and the config file for the winform project I attach it in my last post.

The winform project that use crystal report with a lot of .rpt file work with the line (in config file):

<startup useLegacyV2RuntimeActivationPolicy="true">

    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

</startup>

If I create a simple project winform that display this report I think that it will work

0 Kudos

Hi have you find a solution?

former_member183750
Active Contributor
0 Kudos

Well, I was under the impression that you were on the right path:


If I create a simple project winform that display this report I think that it will work

So, we know CR works. Now you have to figure out what is going on in your actual app. Is the config file being read by the CR engine? I suspect not. Process Monitor may tell you. As I have limited knowledge of your app, it will be up to you to figure out how to get the config file to be read(?).

- Ludek

0 Kudos

Hi, we found a solution, we add "useLegacyV2RuntimeActivationPolicy="true"" in the config file of the winform project because it is this config file that is read and used.

Thank you for your help.

Gwenael

Answers (0)