Junfeng Zhang's Musing

things about the world, world of things

  • Junfeng Zhang's Musing

    foo.exe and foo.dll

    • 0 Comments
    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...
  • Junfeng Zhang's Musing

    AppDomainSetup explained

    • 2 Comments
    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...
  • Junfeng Zhang's Musing

    Return to fusion land

    • 0 Comments
    After much deviation, finally I returned to fusion land. Hope you enjoy it.
  • Junfeng Zhang's Musing

    AppDomain and Shadow Copy

    • 15 Comments
    .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...
  • Junfeng Zhang's Musing

    WritePrivateProfileString and AnitVirus

    • 2 Comments
    Another shocking discovery. WritePrivateProfileString hangs because AntiVirus is accessing the ini file. I really don't know what to do now.
  • Junfeng Zhang's Musing

    vim and Windows Server 2003

    • 1 Comments
    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...
  • Junfeng Zhang's Musing

    How to make an application as both GUI and Console application?

    • 12 Comments
    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...
  • Junfeng Zhang's Musing

    How to tell if an assembly is delay signed or not.

    • 1 Comments
    .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...
  • Junfeng Zhang's Musing

    New categories

    • 0 Comments
    I guess my category management is really horrible. Most of my posts are listed in others. Others is supposed to be non-important stuff! Hope the new categories makes more sense.
  • Junfeng Zhang's Musing

    Longest Java Class Name

    • 6 Comments
    http://www.davidflanagan.com/blog/000017.html I wonder if someone has time to the same analysis on .Net framework. I bet it will be much longer:)
  • Junfeng Zhang's Musing

    How to tell if some file is managed assembly or not?

    • 5 Comments
    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....
  • Junfeng Zhang's Musing

    GetPrivateProfileString/WritePrivateProfileString

    • 10 Comments
    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...
  • Junfeng Zhang's Musing

    How to detect .Net Framework installed in a web client?

    • 3 Comments
    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...
  • Junfeng Zhang's Musing

    How to detect .Net framework installed or not.

    • 13 Comments
    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...
  • Junfeng Zhang's Musing

    Very long assembly name

    • 9 Comments
    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...
  • Junfeng Zhang's Musing

    User friendly file name

    • 4 Comments
    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...
  • Junfeng Zhang's Musing

    Where is .Net framework installed?

    • 2 Comments
    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...
  • Junfeng Zhang's Musing

    How to get thread id for a managed thread?

    • 10 Comments
    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()....
  • Junfeng Zhang's Musing

    How to create circularly referenced assemblies

    • 7 Comments
    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...
  • Junfeng Zhang's Musing

    Microsoft.Net Framework 1.1 setup has ended prematurely

    • 13 Comments
    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...
  • Junfeng Zhang's Musing

    Name of your-app.exe

    • 4 Comments
    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”....
  • Junfeng Zhang's Musing

    Binding Context and LoadFrom

    • 1 Comments
    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...
  • Junfeng Zhang's Musing

    Binding Policy

    • 0 Comments
    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...
  • Junfeng Zhang's Musing

    Partial name binding

    • 0 Comments
    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...
  • Junfeng Zhang's Musing

    Hello, World

    • 4 Comments
    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...
Page 14 of 14 (350 items) «1011121314