Mixed mode assembly is built against version 'v2.0.50727' of theruntime and cannot be loaded in the

S

shapper

Hello,

I am working with VS 2010 / NET 4.0 to create a simple WPF / C#
application.

I am using the following assemblies:

Microsoft.SqlServer.ConnectionInfo
Microsoft.SqlServer.Management.Sdk.Sfc
Microsoft.SqlServer.Smo

The project builds fine but when I run it I get the following 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.

Does anyone knows how to solve this problem?

Is this because my NET is 4.0 and the assemblies are in 2.0?
If that would be the case it wouldn't build ... am I wrong?

Thank You,
Miguel
 
J

Jeroen Mostert

The project builds fine but when I run it I get the following 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.

Does anyone knows how to solve this problem?
Read the message again, especially where it talks about additional
configuration information. Then search the web for this message. Then solve
your problem.
 
E

Elden Armbrust

Jeroen Mostert said:
Read the message again, especially where it talks about additional
configuration information. Then search the web for this message. Then solve
your problem.

Why even comment if your "answer" is going to be like that?
You sir, should not "help" anyone until you know what you're doing.

Now, the answer to the question is to create/edit the file <exe name>.config
and add the following:

<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>

so that the file resembles the following:

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

<runtime>
<generatePublisherEvidence enabled="false" />
</runtime>
</configuration>


So if your application's binary is called "app.exe" then the configuration
file would be named "app.exe.config"

This should fix the problem(s) you're having.

Good luck!
-Elden
 
J

Jeroen Mostert

Why even comment if your "answer" is going to be like that?

Something like "give a man a fish and feed him for a day, beat him with a
cluestick and he'll knows when he should buy a rod instead of begging for food".
You sir, should not "help" anyone until you know what you're doing.
Call it malice if you like, but don't attribute it to ignorance.
 
E

Elden Armbrust

You didn't teach him to fish, you pointed at a fishing pole and said "Go
figure it out." The message is NOT answered where it is easily obtainable.
In fact, the reference I posted was from an ASP.Net related post from
Microsoft. Again, before you go spouting nonsense, please educate yourself
on the subject rather than posting something completely useless. There are
enough useless search results on the internet, why would you want to flaunt
your ignorance of the subject?
The issue is closed, I answered the OP's question. Stop being bitter, and
move on with life.
-E
 
W

Willem van Rumpt

You didn't teach him to fish, you pointed at a fishing pole and said "Go
figure it out." The message is NOT answered where it is easily obtainable.
In fact, the reference I posted was from an ASP.Net related post from
Microsoft. Again, before you go spouting nonsense, please educate yourself
on the subject rather than posting something completely useless. There are
enough useless search results on the internet, why would you want to flaunt
your ignorance of the subject?
The issue is closed, I answered the OP's question. Stop being bitter, and
move on with life.
-E

Enter

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

(The *exact* message associated with the exception) in google.

The first hit has an answer.

It's not about bitterness, it's not about flaunting, it's about making
an actual effort before crying help.
 
J

Jeroen Mostert

On 2010-05-21 19:20, Elden Armbrust wrote:
[handholding]
You didn't teach him to fish, you pointed at a fishing pole and said "Go
figure it out." The message is NOT answered where it is easily obtainable.

Now you're just being silly. Search engines exist for a reason, and the
primary use case for them is when you are searching for something very
specific, like the particular error message the OP posted.

I could have simply replied http://www.justfuckinggoogleit.com, but I
decided to go the extra mile and use complete sentences and such. In fact, I
thought it was rather neat in its terseness. I'm sorry you didn't like it.
On the plus side, it was free.
In fact, the reference I posted was from an ASP.Net related post from
Microsoft. Again, before you go spouting nonsense, please educate yourself
on the subject rather than posting something completely useless.

I did, of course, search for the phrase myself first like the OP might have
done, and got hits aplenty on the first page. The second one in fact had the
solution spelled out. That's just about all the due diligence required, I think.
There are enough useless search results on the internet

There are also enough useful search results. If you feel it's a useful
expenditure of time to play "Search the Web" on behalf of other people, good
for you. I like "Encourage People to Search the Web Themselves" more.
The issue is closed, I answered the OP's question. Stop being bitter,
and move on with life.

I'm not bitter at all, just slightly bemused. You're coming off as terribly
naive. In fact, if you're trolling, good game.
 
Joined
Mar 30, 2006
Messages
2
Reaction score
0
On 2010-04-27 2:45, shapper wrote:
> The project builds fine but when I run it I get the following 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.
>
> Does anyone knows how to solve this problem?
>
Read the message again, especially where it talks about additional
configuration information. Then search the web for this message. Then solve
your problem.

--
J.

Thanks for being so helpful. I think I'm going to ask you whenever I have a question about anything because you are so wise and insightful.
 
V

venu.manchikanti

Hi,

I found a way around this after 3-4 hours of googling. I have added the following in App.Config Configuration.

<startup seLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
</startup>

If above lines doesn't solve your problem then--> In the Project References Right Click on System.Data.SQLite--> Select Properties--> Check the Run-time Version --> If it is v2.0.50727 then we know the problem.
The Problem is:- you are having 2.0 Version of SQLite DLL.
Solution is:- You can delete the System.Data.SQLite from the Project references and then download the latest version of DLL's from the following link and add the reference of the latest version DLL reference then it will work.

http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top