Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

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: http://channel9.msdn.com/ShowPost.aspx?PostID=7959
Posted by Suzanne Cook | 19 Comments
Filed under:

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,
Posted by Suzanne Cook | 16 Comments
Filed under:

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
Posted by Suzanne Cook | 4 Comments
Filed under:

Load(AssemblyName)

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
Posted by Suzanne Cook | 7 Comments
Filed under:

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

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"/>
Posted by Suzanne Cook | 25 Comments
Filed under:

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
Posted by Suzanne Cook | 10 Comments
Filed under:

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 failures

Where to Find Technical Support

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. Unfortunately,

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.

LoadFile vs. LoadFrom

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 Fusion
Posted by Suzanne Cook | 12 Comments
Filed under:

LoadFrom's Second Bind

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
Posted by Suzanne Cook | 2 Comments
Filed under:

Avoid DevPath

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. :)
Posted by Suzanne Cook | 16 Comments
Filed under:

ReflectionTypeLoadException

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

Binding to .NET Frameworks Assemblies

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
Posted by Suzanne Cook | 3 Comments
Filed under:
More Posts Next page »
 
Page view tracker