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

Discussion in 'Microsoft C# .NET' started by shapper, Apr 27, 2010.

  1. shapper

    shapper Guest

    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
     
    shapper, Apr 27, 2010
    #1
    1. Advertisements

  2. Re: Mixed mode assembly is built against version 'v2.0.50727' ofthe runtime and cannot be loaded in the 4.0 runtime ... Please, how to solvethis

    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.
     
    Jeroen Mostert, Apr 27, 2010
    #2
    1. Advertisements

  3. Re: Mixed mode assembly is built against version 'v2.0.50727' of t

    "Jeroen Mostert" wrote:

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


    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
     
    Elden Armbrust, May 20, 2010
    #3
  4. Re: Mixed mode assembly is built against version 'v2.0.50727' oft

    On 2010-05-20 21:35, Elden Armbrust wrote:
    >
    >
    > "Jeroen Mostert" wrote:
    >
    >> 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.
    >>

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

    --
    J.
     
    Jeroen Mostert, May 21, 2010
    #4
  5. Re: Mixed mode assembly is built against version 'v2.0.50727' of t

    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


    "Jeroen Mostert" wrote:

    > On 2010-05-20 21:35, Elden Armbrust wrote:
    > >
    > >
    > > "Jeroen Mostert" wrote:
    > >
    > >> 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.
    > >>

    > >
    > > 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.
    >
    > --
    > J.
    > .
    >
     
    Elden Armbrust, May 21, 2010
    #5
  6. Re: Mixed mode assembly is built against version 'v2.0.50727' oft

    On 21-5-2010 19:20, Elden Armbrust wrote:
    > 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.

    --
    Willem van Rumpt
     
    Willem van Rumpt, May 21, 2010
    #6
  7. Re: Mixed mode assembly is built against version 'v2.0.50727' oft

    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.

    --
    J.
     
    Jeroen Mostert, May 21, 2010
    #7
  8. shapper

    Anyhoo

    Joined:
    Mar 30, 2006
    Messages:
    2
    Likes Received:
    0
    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.
     
    Anyhoo, Mar 30, 2012
    #8
  9. shapper

    Guest

    Re: Mixed mode assembly is built against version 'v2.0.50727' of t

    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
     
    , Dec 28, 2013
    #9
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kerem Gümrükcü

    Protecting Assembly against disassembling...

    Kerem Gümrükcü, Mar 10, 2005, in forum: Microsoft C# .NET
    Replies:
    0
    Views:
    213
    Kerem Gümrükcü
    Mar 10, 2005
  2. Replies:
    6
    Views:
    571
  3. Zytan

    Assembly version vs. File version

    Zytan, Apr 28, 2007, in forum: Microsoft C# .NET
    Replies:
    6
    Views:
    352
    Zytan
    May 1, 2007
  4. C# 2.0.50727 compiler crashes

    , Nov 22, 2007, in forum: Microsoft C# .NET
    Replies:
    2
    Views:
    222
  5. Peter Olcott
    Replies:
    0
    Views:
    224
    Peter Olcott
    Oct 21, 2008
Loading...

Share This Page