<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d11356004\x26blogName\x3dxception\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://openrent.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://openrent.blogspot.com/\x26vt\x3d-4655156434419967503', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Don't debug an unmanaged application

Since most of the world is .NET these days, its my tendency to think I can find everything using SOS. Recently, I was attempting to debug a Windows service (Office SharePoint Server Search), and mentally thought "Well, its SharePoint, which is nothing more than a large .NET application, do its .NET as well." After opening Windbg, and trying to load SOS, I got the following error:

"Failed to find runtime DLL (mscorwks.dll), 0x80004005
Extension commands need mscorwks.dll in order to have something to do."

This perplexed me until I realized I was trying to debug an application that is not managed. To prove this, I ran the "lmvm mscorwks" command to see if mscorwks.dll was loaded. It wasn't.

Deploying a webpart by command line

stsadm -o addsolution -filename c:\temp\LogViewer.wsp
stsadm -o deploysolution -name LogViewer.wsp -immediate -allcontenturls
stsadm -o execadmsvcjobs

Sharepoint Crawler: "Access is denied"

Ensure the crawl account has Read access to the web application you wish to crawl. Open Central Admin -> Application Management --> Application Security section --> Policy for Web Application. Add the default crawl user here for All Zones for each web application you want to crawl. Be sure to specify the correct web application.

(Note: Find the default content access account in your SSP under Search --> Search Settings.)

Tracking .NET Out-Of-Memory errors

Add the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework

Value name: GCFailFastOnOOM
Value type: REG_DWORD
Value data: 4

The value of "4" writes an event message that includes the size of the allocation that failed and the number of bytes in use. A value of "1" simply logs an event in the Application event log. A value of "2" allows a debugger to be attached.

Use the "4" option to grab a dump, then examine the dump for severe fragmentation of the heap, or an attempt to allocate a huge object.

Debugging a different version of .NET runtime

Copy the mscorwks.dll from the machine that has a different .NET version (than the version running on your debugging desktop) to the C:\temp directory. Rename the file with the name "mscordacwks" and the version of .NET framework it came from, like this: mscordacwks_2.0.50727.1433.63.dll

In WinDBG, issue the following command: cdb -z c:\temp\mscordacwks_2.0.50727.1433.63.dll


Use Ctrl+Alt+Delete in an RDP session

Ctrl + Alt + End inside the RDP session.

Get uptime of windows server

net statistics workstation

Unicode HTML space character

Use one of the following for a space: %u1160 or %u0020, for example:

http://emeaportal.lendlease.com/contractual%u1160documents/forms/rssview.aspx
http://emeaportal.lendlease.com/contractual%u0020documents/forms/rssview.aspx

How many crawls have been done?

Select count(distinct crawlid) from msscrawlurllog