So that I got a complain today about foo.exe and foo.dll.
The whole story is like this: The tester produces two binaries foo.exe and foo.dll, with the same identity (name, version, culture, public key token). And the tester uses gacutil to install...

AppDomainSetup is a properties bag. It stores various properties that affects binding decision in an appdomain, as well as other decision as well. MSDN documents each properties in AppDomainSetup. But there are a few properties that are not well explained...

.Net Framework has a feature called Shadow Copy . When shadow copy is enabled on an appdomain, assemblies loaded in that appdomain will be copied to a shadow copy cache directory, and will be used from there. This is great because the original file is...

I am a vim user. If you use vim under Windows Server 2003, you may find this useful.
vim6.2 has a bug in Windows Server 2003. It does not save the console buffer correctly. When vim exists, the console buffer is empty.
Fix is available from http...

This is another common asked question. But it is a Win32 question.
In Windows GUI applications and Console applications are very different. GUI applications have at least one window, and a message loop, but no standard in/out/error. Console applications...

.Net framework has a great feature called delay signing. Every strongly named assembly has a public key, and a strong name hash stored in the metadata. At runtime CLR uses the public key to verify the strong name hash to make sure the assembly is not...

Another commonly asked question.
There are many ways to detect if a given file is a managed assembly or not. For example, in VS.Net 2002/2003, dumpbin has an option /clrheader. It will dump the CLR header for you if the file is a managed assembly....

Learned a hard lesson. Contention between GetPrivateProfileString and WritePrivateProfileString may cause a deadlock, even for multiple processes. If you intent to Read/Write the same ini file, you have to lock the file yourself.
Yes, I know they are...

In my last post I talked about how to detect .Net framework installed in your local machine. This is another .Net framework detection. But not for you, it is for web servers. Suppose you browse some web site. How does that web site know if you have installed...

This is another frequently asked question.
If you search google how to detect .Net Framework , this( http://support.microsoft.com/default.aspx?scid=kb;%5BLN%5D;315291 ) page ranks very high.
Ignore all the details in the KB articles. It basically...

Speaking of file name inspired me to write another post about assembly name.
Windows supports long file path since Win95 time. It has a MAX_PATH limit, which is defined as 260.
Prior to .Net era, you seldom see long file name. If you poke around...

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

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

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()....

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

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

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”....

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

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

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