Cannot Install Windows SDK :(

  You try to install latest Windows SDK and it does not work. If you look at the setup log file and you see: 8:58:43 AM Wednesday, June 27, 2012: C:\WinSDK\Setup\SFX\vcredist_x64.exe installation failed with return code 5100 Reason for this is you have a newer C++ runtime installed on your machine, for example by Visual…


Windows Diagnostics with Windows Azure Issue

  Windows Azure Diagnostics does not work, you see following in the Compute Emulator => [Diagnostics]: Error starting diagnostics: System.FormatException: Invalid account string.    at Microsoft.WindowsAzure.CloudStorageAccount.<Parse>b__0(String err)    at Microsoft.WindowsAzure.CloudStorageAccount.ParseStringIntoSettings(String s, Action`1 error)    at Microsoft.WindowsAzure.CloudStorageAccount.TryParse(String s, CloudStorageAccount& accountInformation, Action`1 error)    at Microsoft.WindowsAzure.CloudStorageAccount.Parse(String value)    at Microsoft.WindowsAzure.Plugins.Diagnostics.DiagnosticsAgentManager.<StartAgent>b__0()   Reason?  The reason is a connecting string parsing bug in Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString =>…


Enabling Advanced Driver Tracing for the SQL Native Client ODBC Drivers

  If you are using the SQL Native Client ODBC driver, there is built-in high performance very detailed driver tracing, here is how you use it. #1. Create batch file to start tracing (this traces for all three versions of SQL Native Client ODBC Driver) named StartSNACTrace.cmd: @echo off echo Starting SNAC tracing… echo {BA798F36-2325-EC5B-ECF8-76958A2AF9B5}…


PowerShell Command Separator Is ; and Not &

  Ahh PowerShell, I still cannot fully embrace your powerful weirdness. With normal NT command prompt I can restart my SQL Server by running => net stop mssqlserver  & net start mssqlserver This does not work in PowerShell, you get the usual cryptic, nonsensical and useless error message: PS C:\> net stop mssqlserver & net…


Disabling => CLRDLL: No CLR image loaded (i.e. mscorwks.dll)

I’m debugging using the Debugging Tools For Windows (WinDbg).  Debugging a native C++ process (no CLR loaded). I find with every debugger command I run, I get annoying amounts of debugger logging spew saying “CLRDLL: No CLR image loaded (i.e. mscorwks.dll)”. For example, when I dump a call stack I see: 0:000> kC CLRDLL: No…


Calculating read_only_routing_url for AlwaysOn

  When setting up read-only routing for SQL Server AlwaysOn, you have to configure each availability replica with a read-only routing URL. The read-only routing URL is just a “pointer” to the replica and determines what the replica will report back to the client driver when routing to the replica. Suppose you have an AlwaysOn…


Tracking Handle Misuse Using Application Verifier and Windbg

In a recent MSDN forum post Connection Pooling randomly throwing COM exceptions I uncovered an issue where some code inside the process was closing handles owned by our pooling code.  This caused our pooling code to get into a bad state triggering a SemaphoreFullException every single time a caller attempted to open a connection from…


Nice day



How to tell if binary is x86 or amd64?

First get dumpbin tool, ships with any Windows SDK. Run dumpbin /headers on the binary, then look at the magic number. This is an amd64 binary:   c:\>dumpbin /headers c:\amd64\msvcr100.dll | findstr magic              20B magic # (PE32+) This is a 32-bit binary:   c:\DPMedusa1>dumpbin /headers c:\x86\msvcr100.dll | findstr magic              10B magic # (PE32)…



Just a note to self, when typing in TrustedInstaller into security dialogs in Vista/Windows 2008, be sure to prefix with:     NT SERVICE\TrustedInstaller C:\Windows>icacls c:\windows\winsxs c:\windows\winsxs                   NT SERVICE\TrustedInstaller:(OI)(CI)(F)                   BUILTIN\Administrators:(OI)(CI)(RX)                   NT AUTHORITY\SYSTEM:(OI)(CI)(RX)                   BUILTIN\Users:(OI)(CI)(RX)   The security UI dialogs do not recognize TrustedInstaller just by itself (don’t know why).