none
Mixed .Net versions RRS feed

  • Question

  • I'm a little confused by something I saw today.

    I have an assembly A.dll built for .Net 3.5 - it has a ref to System.Core v 3.5.0.0

    I have an assembly B.dll built for .Net 4.0 - it has a ref to the first assembly and a ref to System.Core v 4.0.0.0

    A also has a ref to mscorlib v 2.0.0.0 and B has refs to mscorlib v 2.0.0.0 and mscorlib v 4.0.0.0

    An app that loads B runs fine and I can see assembly A in the Modules list under debug, I can also see mscorlib v 4.0.0.0 in the same Modules list but not mscorlib v 2.0.0.0

    Clearly this runs OK but should it? Is there something wrong?

    Cap'n

    Monday, November 19, 2012 8:45 PM

Answers

  • No.  This is normal behavior when you reference a CLR 2 (.NET 3.5) assembly from within CLR 4.  The mscorlib 2.0 reference maps to a 4.0 reference at runtime, so the application using "B" will automatically always use mscorlib 4.0.


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    • Marked as answer by Captain Kernel Monday, November 19, 2012 9:05 PM
    Monday, November 19, 2012 9:03 PM
    Moderator

All replies

  • No.  This is normal behavior when you reference a CLR 2 (.NET 3.5) assembly from within CLR 4.  The mscorlib 2.0 reference maps to a 4.0 reference at runtime, so the application using "B" will automatically always use mscorlib 4.0.


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    • Marked as answer by Captain Kernel Monday, November 19, 2012 9:05 PM
    Monday, November 19, 2012 9:03 PM
    Moderator
  • No.  This is normal behavior when you reference a CLR 2 (.NET 3.5) assembly from within CLR 4.  The mscorlib 2.0 reference maps to a 4.0 reference at runtime, so the application using "B" will automatically always use mscorlib 4.0.


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Thanks Reed - that makes sense but was bewildering me !

    Cheers

    Cap'n

    Monday, November 19, 2012 9:05 PM