473,394 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" );

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

Assembly.Load( "mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" );

Anyone shed some light?
Regards
Lee


Nov 15 '05 #1
2 1489
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_Please_Digita.com> wrote in message
news:uK****************@TK2MSFTNGP10.phx.gbl...
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.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" );

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

Assembly.Load( "mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" );

Anyone shed some light?
Regards
Lee

Nov 15 '05 #2
For Assembly.Load related question, nothing beats Suzanne's blog.

http://blogs.gotdotnet.com/suzcook/c...8-39850cf1b98d
"Marcelo Birnbach [MS]" <mb******@online.microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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_Please_Digita.com> wrote in message
news:uK****************@TK2MSFTNGP10.phx.gbl...
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.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" );

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

Assembly.Load( "mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" );

Anyone shed some light?
Regards
Lee


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Angelos Karantzalis | last post by:
Hi guys, I'm trying to load a class instance dynamically, and then cast it to it's base type so I can use it in my app. More specifically, I'm dynamically instantiating a...
8
by: Shaun C Farrugia | last post by:
I have a multi team solution being built where teams are segmented off into seperate projects. One project is an over all framework containing a Broker class responsible for instantiating...
1
by: Mike Malter | last post by:
I am just starting to work with reflection and I want to create a log that saves relevant information if a method call fails so I can call that method again later using reflection. I am...
12
by: Jones | last post by:
I am having problems with my C# project. The project was built using VS.net (original release with service pack 1). The project includes windows forms and a DLL (dot.net) After getting the...
2
by: Dan | last post by:
Let's say I have a class like: class Dummy { public const string CONE = "one"; public const string CTWO = "two"; ... other stuff .... }
4
by: Doug Handler | last post by:
Ok, I think this is my last one - in my app, the user can select via a dialog box the dll's they want to load. I use a checkbox to track this (no worries there), but, once a dll has been bound,...
3
by: John Wright | last post by:
How can I set the property of a loaded Assembly using reflection. My Shell program will log in a person and retrieve a list of all programs the person can use. When the shell program launches a...
0
by: knightrider | last post by:
I am trying to iterate through all of the assemblies in the share that is our production source code repository and gather information about the assemblies (number of classes and methods contained...
2
by: Srikumar Natarajan | last post by:
I have a question on Reflections. Basically, I have two visual studio solutions: SolA & SolB. SolA has a console application project and a class library project. SolB has some framework class...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.