Suzanne Cook's .NET CLR Notes

Common Language Runtime Developer

June, 2003

  • Suzanne Cook's .NET CLR Notes


    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...
  • Suzanne Cook's .NET CLR Notes

    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...
  • Suzanne Cook's .NET CLR Notes

    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...
  • Suzanne Cook's .NET CLR Notes


    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...
  • Suzanne Cook's .NET CLR Notes

    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...
  • Suzanne Cook's .NET CLR Notes

    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...
  • Suzanne Cook's .NET CLR Notes

    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...
Page 1 of 1 (7 items)