Question about Assembly.Load

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lee Alexander

    #1

    Question about Assembly.Load

    Why does Assembly.Load allow this:

    Assembly.Load( "mscorlib" );

    if you try the following it fails as expected:
    Assembly.Load( "System" );

    Since it should be (for framework 1.1):
    Assembly.Load( "System, Version=1.0.500 0.0, Culture=neutral ,
    PublicKeyToken= b77a5c561934e08 9" );

    I would have thought you would have had to do the same for mscorlib.

    Assembly.Load( "mscorlib, Version=1.0.500 0.0, Culture=neutral ,
    PublicKeyToken= b77a5c561934e08 9" );



    Anyone shed some light?


    Regards
    Lee




  • Marcelo Birnbach [MS]

    #2
    Re: Question about Assembly.Load

    mscorlib is a special case since you can only have one version of it per
    process. When your managed application is started there is already a version
    of mscorlib loaded in the process, so specifying the version of mscorlib is
    completely redundant information.

    Thanks,
    Marcelo

    "Lee Alexander" <lee@No_Spam_Pl ease_Digita.com > wrote in message
    news:uK825%23Xb DHA.2404@TK2MSF TNGP10.phx.gbl. ..[color=blue]
    > Why does Assembly.Load allow this:
    >
    > Assembly.Load( "mscorlib" );
    >
    > if you try the following it fails as expected:
    > Assembly.Load( "System" );
    >
    > Since it should be (for framework 1.1):
    > Assembly.Load( "System, Version=1.0.500 0.0, Culture=neutral ,
    > PublicKeyToken= b77a5c561934e08 9" );
    >
    > I would have thought you would have had to do the same for mscorlib.
    >
    > Assembly.Load( "mscorlib, Version=1.0.500 0.0, Culture=neutral ,
    > PublicKeyToken= b77a5c561934e08 9" );
    >
    >
    >
    > Anyone shed some light?
    >
    >
    > Regards
    > Lee
    >
    >
    >
    >[/color]


    Comment

    • Conrad Zhang

      #3
      Re: Question about Assembly.Load

      For Assembly.Load related question, nothing beats Suzanne's blog.




      "Marcelo Birnbach [MS]" <mbirnbac@onlin e.microsoft.com > wrote in message
      news:%236hVMFbb DHA.1872@TK2MSF TNGP12.phx.gbl. ..[color=blue]
      > mscorlib is a special case since you can only have one version of it per
      > process. When your managed application is started there is already a[/color]
      version[color=blue]
      > of mscorlib loaded in the process, so specifying the version of mscorlib[/color]
      is[color=blue]
      > completely redundant information.
      >
      > Thanks,
      > Marcelo
      >
      > "Lee Alexander" <lee@No_Spam_Pl ease_Digita.com > wrote in message
      > news:uK825%23Xb DHA.2404@TK2MSF TNGP10.phx.gbl. ..[color=green]
      > > Why does Assembly.Load allow this:
      > >
      > > Assembly.Load( "mscorlib" );
      > >
      > > if you try the following it fails as expected:
      > > Assembly.Load( "System" );
      > >
      > > Since it should be (for framework 1.1):
      > > Assembly.Load( "System, Version=1.0.500 0.0, Culture=neutral ,
      > > PublicKeyToken= b77a5c561934e08 9" );
      > >
      > > I would have thought you would have had to do the same for mscorlib.
      > >
      > > Assembly.Load( "mscorlib, Version=1.0.500 0.0, Culture=neutral ,
      > > PublicKeyToken= b77a5c561934e08 9" );
      > >
      > >
      > >
      > > Anyone shed some light?
      > >
      > >
      > > Regards
      > > Lee
      > >
      > >
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...