User friendly file name

There was an interesting discussion not long ago. People complain file names are just too user un-unfriendly. What is WISPTIS.exe? It is “Microsoft Tablet PC Platform Component”.  How could you tell from its name? Valid complain. Other people have rebuttal. File name is never meant to user friendly. If it is, what does it mean…

4

Where is .Net framework installed?

This is another often-asked question. As of today, there is no managed answer. mscoree!GetCORSystemDirectory returns the directory of where .Net framework is installed. It is documented here (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/grfungetcorsystemdirectory.asp). Note the document is not complete. Here is what it says: <quote>Returns the installation directory of the common language runtime that is loaded into the process. The…

2

How to get thread id for a managed thread?

This question comes up from time to time. The answer is, there is no explicit numeric thread id for managed thread today in .Net framework. Now if you do need a numeric thread id for whatever reason, you can use System.Threading.Thread.GetHashCode(). This is documented here.   [update: In .Net framework 2.0, you can use System.Threading.Thread.ManagedThreadId…

10

How to create circularly referenced assemblies

In .Net framework System.dll and System.Xml.dll reference each other. How is it possible? Circularly referenced assemblies are chicken-and-egg problem. The trick is how to break the dependency chain. Here is one way I find working. Step 1. Create assembly A, includes A only types. A references nothing. (Except framework assemblies).Step 2. Create assembly B, uses…

7

Microsoft.Net Framework 1.1 setup has ended prematurely

This trick may have shown up somewhere else. But I still see people asking the same question. So I’ll post it in my blog. Many people experience failure when installing .Net Framework 1.1 Redist. Usually you see a MSI dialog says “Internal Error 2908.”. Later you will see another dialog says “Error 1935. An error…

13

Name of your-app.exe

MSDN says your assembly’s file name should be assembly’s simple name, plus .dll/.exe. The reason is those are what we probe. Remember the probing rule? But your-app.exe can be an exception. The exe may have an assembly name of “MyAsm”. But the file name can be anything. The reason it works is because there is…

4

Binding Context and LoadFrom

Suzanne has a discussion about binding context here. A binding context is really just a loaded assembly cache. MSDN describes how runtime locates assemblies here. What is missing is that there is a step 5. When we find an assembly, we put it in a binding context, indexed by its full name (again, “name, Version=xxxx,…

1

Binding Policy

Alan has a great write-up about assembly binding policy. I’ll copy a paragraph to avoid duplicate discussion: <quote> Fusion offers a rich (albeit complex) binding policy system that allows various parties to influence assembly binding behaviour by authoring XML configuration files that can redirect a reference to one version of an assembly to another. The three…


Partial name binding

MSDN documents how the runtime locates assemblies here. The probing logic is implemented in fusion. The documentation is correct if the given assembly name is fully specified. A fully specified assembly name is of the following format: “name, Version=xxxx, Culture=xxxx, PublicKeyToken=xxxx”. Now what if the given assembly name is not fully specified? The probing logic…


Hello, World

Hi there, My name is Junfeng Zhang and I work in fusion team under AlanShi. Before I joined Microsoft I was a graduate student in University of Wisconsin-Madison. Prior to that I studied in University of Science and Technology of China, in Hefei, Anhui, CHINA. In my day-to-day work I primarily interact with CLR loader…

4