Channel 9 Interview

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:


New Assembly, Old .NET (and Vice-Versa)

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, newer .NET But, sometimes you don’t run against the same version that you built against. For…


Versioning/Deploying Unmanaged Files

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 code – no managed code, if you prefer. It can also…



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 properties, it would be the same as if you had specified those properties in a String (as…


Debugging an InvalidCastException

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 seems fine, check to see if the assemblies for those two types are loaded from different locations and…


App.config Examples

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 version=”v1.0.3705″/>          <supportedRuntime version=”v1.0.3705″/>      </startup>  </configuration> Redirects “assemblyName, Version=, Culture=neutral, PublicKeyToken=25283151a234958d“ to version of that assembly. This…


Determining Whether a File Is an Assembly

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 that it may not be a PE file,…


Debugging a MissingMethodException, MissingFieldException, TypeLoadException

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 failuresFirst, check for assembly binding failures by getting the Fusion log. Look for the assembly containing that method/field/type or assemblies containing types referenced…


Where to Find Technical Support

Microsoft’s official support website is 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. Unfortunately, I can’t give attention to individual customer issues. That’s because I work in product design and development, not customer support….


Determining the Referencing Assembly

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 bind. If the version 1.0 assembly was…