When access a symbolic link on a file server, sometimes you may see the following error: “The symbolic link cannot be followed because its type is disabled” This is because by default remote to remote symbolic links are disabled. You can enable it with fsutil. C:\Windows\system32>fsutil behavior query SymlinkEvaluation Local to local symbolic links are enabled.Local…

A while ago, an internal thread shows how to get where the exception is thrown in Windows Error Report for managed application without a dump. The thread is very insightful. Shared below: Subject: RE: How to investigate Windows Error Report from managed app? FYI I actually found that there is way to find…

Internal manifest is the RT_MANIFEST resource in the executable. External manifest is App.exe.manifest. In Windows XP, Sxs searches external manifest before internal manifest. If an external manifest is found, the internal manifest is ignored. In Windows Server 2003 and later, the order is reversed. Internal manifest is preferred over external manifest. If you use external…

CLR HRESULT’ facility code is 0x13. If an HRESULT error is 0x8013xxxx, it is likely a CLR error. All CLR errors are defined in CorError.h. You can find CorError.h in your Visual Studio install (or Microsoft Platform SDK). C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\CorError.h For example, #define FUSION_E_REF_DEF_MISMATCH EMAKEHR(0x1040) // The located assembly’s manifest definition does not match…

C# does not support exception filter. However, VB and IL support it. To add exception filter to C#, we can build a function in VB or IL, then call it in C#. The example below is one way we may implement the function to support exception filter. It asks the caller to provide four delegates,…

CLR’s thread pool has two pools of threads. The first pool is used by ThreadPool.QueueUserWorkItem. The second pool is an IoCompletionPort thread pool used by ThreadPool.BindHandle and ThreadPool.UnsafeQueueNativeOverlapped. ThreadPool.BindHandle is used by CLR to implement asynchronous IO. For example, FileStream uses it to implement BeginRead/BeginWrite. Developers can take advantage of it too. We will talk…

We can convert a char * to System.String with System.String’s constructor string str = new string((char*)p); And for the reverse: fixed(char *p = str){} Why do we care about conversion between System.String and char *? From this article, this is the fastest way to marshal strings between managed and native boundary.

If you have used your Vista SP1-based computer for extended period, you may experience some problems starting large applications, for example, Office 2007 applications. Specifically, you may receive a message “XXX is not a valid Win32 application”. If you do experience this problem, you can install hotfix KB952709. http://support.microsoft.com/kb/952709/