Welcome to MSDN Blogs Sign in | Join | Help

June 2003 - Posts

Mscorlib.dll

At least for v2 and earlier, mscorlib.dll is a special case. That causes it and its types to be loaded differently from other assemblies. Loading Mscorlib.dll Without a Path It and the execution engine are so closely integrated that it's required that
Posted by Suzanne Cook | 28 Comments
Filed under:

Assembly.CodeBase vs. Assembly.Location

The CodeBase is a URL to the place where the file was found, while the Location is the path from where it was actually loaded. For example, if the assembly was downloaded from the internet, its CodeBase may start with "http://", but its Location may start
Posted by Suzanne Cook | 7 Comments
Filed under:

Determining an Image’s CLR Version

To get it programmatically, from managed code, use Assembly.ImageRuntimeVersion. From unmanaged, use mscoree.dll's GetFileVersion(). (From the command line, starting in v2.0, ildasm.exe will show it if you double-click on "MANIFEST" and look for "Metadata
Posted by Suzanne Cook | 11 Comments
Filed under:

AppDomain.Load()

AppDomain.Load() is only meant to be called on AppDomain.CurrentDomain. (It's meant for interop callers only. They need a non-static method, and Assembly.Load() is static.) If you call it on a different AppDomain, if the assembly successfully loads in
Posted by Suzanne Cook | 5 Comments
Filed under:

Switching to the Load Context

So, after checking out the binding context options , you've decided to switch your app to use the Load context. Now, you just need to figure out how to do it. Maybe it will be as simple as using Assembly.Load( assemblyDisplayName ) instead of Load(byte[]),
Posted by Suzanne Cook | 14 Comments
Filed under:

Executing Code in Another AppDomain

The easiest way to run code in another appdomain is to execute an assembly entrypoint using AppDomain.ExecuteAssembly() or (starting in v2.0) AppDomain.ExecuteAssemblyByName(). If you want to execute a method other than an assembly entrypoint, call AppDomain.CreateInstance()
Posted by Suzanne Cook | 45 Comments
Filed under:

App.Config Files

By default, the application configuration file of the default appdomain (and other appdomains for v1.1 and later) is in the process exe’s directory and named the same as the process exe + ".config". This is true even if that exe is unmanaged. Also, note
Posted by Suzanne Cook | 33 Comments
Filed under:
 
Page view tracker