Sign in
Suzanne Cook's .NET CLR Notes
Common Language Runtime Developer
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
RSS for posts
Atom
RSS for comments
OK
Search
Tags
Loader Debugging Advice
Loader Info
Archive
Archives
February 2005
(1)
January 2005
(1)
October 2004
(1)
August 2004
(1)
June 2004
(1)
May 2004
(1)
March 2004
(1)
February 2004
(1)
December 2003
(1)
November 2003
(1)
September 2003
(2)
August 2003
(2)
July 2003
(3)
June 2003
(7)
May 2003
(6)
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
Suzanne Cook's .NET CLR Notes
Channel 9 Interview
Posted
over 8 years ago
by
Suzanne Cook
19
Comments
Charles Torre and Robert Scoble (behind the camera) dropped by my office to chat with me about the loader for MSDN's Channel 9: part I and part II . Also, check out the PDC video I was in for Channel 9: http://channel9.msdn.com/ShowPost.aspx?PostID=79591
Suzanne Cook's .NET CLR Notes
New Assembly, Old .NET (and Vice-Versa)
Posted
over 8 years ago
by
Suzanne Cook
17
Comments
I typically recommend that you build and test your assemblies against the same version of .NET that you will be running them against. That way, you'll have correct references and avoid surprises from behavior differences between builds. Older assembly...
Suzanne Cook's .NET CLR Notes
Versioning/Deploying Unmanaged Files
Posted
over 9 years ago
by
Suzanne Cook
4
Comments
An unmanaged dll can be wrapped in a managed assembly by adding it as a file of a multi-module assembly. Then, it can be deployed and versioned in the same way as managed assemblies. (So, that assembly could contain nothing but metadata and unmanaged...
Suzanne Cook's .NET CLR Notes
Load(AssemblyName)
Posted
over 9 years ago
by
Suzanne Cook
7
Comments
Calling Load(AssemblyName) is not necessarily the same as calling Load(String). If the AssemblyName.CodeBase is not set, then they do do the same thing. So, if you've set the AssemblyName.Name, CultureInfo, public key token / public key and/or Version...
Suzanne Cook's .NET CLR Notes
Debugging an InvalidCastException
Posted
over 9 years ago
by
Suzanne Cook
11
Comments
First, obviously, find the two types for which the cast failed and verify that they are the same type or otherwise castable. Next, if the type was just deserialized, also verify that its assembly successfully loaded in the target appdomain. If everything...
Suzanne Cook's .NET CLR Notes
App.config Examples
Posted
over 9 years ago
by
Suzanne Cook
25
Comments
Below are three examples of useful application configuration files . Forces the v1.0 CLR to be run. If the v1.0 CLR is not installed, the app will fail to run. <?xml version ="1.0"?> <configuration> <startup> <requiredRuntime...
Suzanne Cook's .NET CLR Notes
Determining Whether a File Is an Assembly
Posted
over 9 years ago
by
Suzanne Cook
10
Comments
A file is an assembly if and only if it's managed and it contains an Assembly entry in its CLR metadata. Determining by hand A fast way to determine whether a file is an assembly is to run ildasm.exe on it. If it immediately gives an error saying...
Suzanne Cook's .NET CLR Notes
Debugging a MissingMethodException, MissingFieldException, TypeLoadException
Posted
over 9 years ago
by
Suzanne Cook
14
Comments
Say you've just installed some assemblies from a third party and now you're seeing a MissingMethodException, MissingFieldException, or TypeLoadException (during the run of an application using those assemblies). Below are the common causes. Loading...
Suzanne Cook's .NET CLR Notes
Where to Find Technical Support
Posted
over 10 years ago
by
Suzanne Cook
14
Comments
Microsoft's official support website is http://support.microsoft.com/ . It has all kinds of resources like product FAQs, downloads, searchable KB articles, newsgroup pointers, and ways to reach people to help with your individual needs or feedback. ...
Suzanne Cook's .NET CLR Notes
Determining the Referencing Assembly
Posted
over 10 years ago
by
Suzanne Cook
2
Comments
Say you're debugging your application and you see that version 1.0 of an assembly is being loaded when you thought it should be version 2.0. Where is the reference to 1.0 coming from? The easiest way to find out is to look at the Fusion log for this...
Suzanne Cook's .NET CLR Notes
LoadFile vs. LoadFrom
Posted
over 10 years ago
by
Suzanne Cook
12
Comments
Be careful - these aren't the same thing. LoadFrom() goes through Fusion and can be redirected to another assembly at a different path but with that same identity if one is already loaded in the LoadFrom context. LoadFile() doesn't bind through...
Suzanne Cook's .NET CLR Notes
LoadFrom's Second Bind
Posted
over 10 years ago
by
Suzanne Cook
2
Comments
Pre-v2, when you load an assembly by path through Fusion (LoadFrom(), ExecuteAssembly(), etc.), it can actually cause two binds, not just one. The first bind loads the file at the given path. If that is successful, another bind is done with the display...
Suzanne Cook's .NET CLR Notes
Avoid DevPath
Posted
over 10 years ago
by
Suzanne Cook
16
Comments
I hesitate to talk about this because I don't want people who don't know about it to think, "Hey, what's this DevPath thing? I need that." But, maybe if I don't explain how to use it, it will be too much effort for people who don't already know how. ...
Suzanne Cook's .NET CLR Notes
ReflectionTypeLoadException
Posted
over 10 years ago
by
Suzanne Cook
11
Comments
If a type can't be loaded for some reason during a call to Module.GetTypes(), ReflectionTypeLoadException will be thrown. Assembly.GetTypes() also throws this because it calls Module.GetTypes(). The Message for this exception is "One or more exceptions...
Suzanne Cook's .NET CLR Notes
Binding to .NET Frameworks Assemblies
Posted
over 10 years ago
by
Suzanne Cook
3
Comments
By "Frameworks assemblies," I mean the assemblies that ship with the CLR. But, I'm not counting mscorlib.dll , since it's special in a different way. With v1.0 SP3 or later, Frameworks assemblies are unified. That means that the version of those assemblies...
Suzanne Cook's .NET CLR Notes
Assembly Identity
Posted
over 10 years ago
by
Suzanne Cook
16
Comments
There are two types of assembly identity that the loader deals with: bind-time and after bind-time. The identity is used to determine whether we will consider a certain assembly to be the same thing as an assembly reference or another assembly. Assembly...
Suzanne Cook's .NET CLR Notes
Unloading an Assembly
Posted
over 10 years ago
by
Suzanne Cook
30
Comments
There's no way to unload an individual assembly without unloading all of the appdomains containing it. (See here for why not.) This can by done by calling AppDomain.Unload() for each AppDomain that has it loaded. (You could also use UnloadDomain() on...
Suzanne Cook's .NET CLR Notes
Mscorlib.dll
Posted
over 10 years ago
by
Suzanne Cook
28
Comments
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
Posted
over 10 years ago
by
Suzanne Cook
7
Comments
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
Posted
over 10 years ago
by
Suzanne Cook
11
Comments
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()
Posted
over 10 years ago
by
Suzanne Cook
8
Comments
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
Posted
over 10 years ago
by
Suzanne Cook
14
Comments
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
Posted
over 10 years ago
by
Suzanne Cook
46
Comments
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
Posted
over 10 years ago
by
Suzanne Cook
37
Comments
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...
Suzanne Cook's .NET CLR Notes
Avoid Partial Binds
Posted
over 10 years ago
by
Suzanne Cook
13
Comments
A partial bind is when only part of the assembly display name is given when loading an assembly. Assembly.LoadWithPartialName() also uses partial binding. First, it calls Assembly.Load(). But, if that fails to find the assembly, it will return the...
Page 1 of 2 (30 items)
1
2