Monday, October 15, 2007

How to uninstall SQL 2005 if it's missing in Add/Remove Programs

First of all - here is the support KB article.
In my case - I was unable to uninstall SQL 2005 even manually from the command line (ArpWrapper was ceasing to work, displaying some "Registry Enumeration Failed" error and uninstalling components with MsiExec using their GUID's listed in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall just didn't worked).

I was able to do it by uninstalling SQL components manually with Microsoft Windows Install Clean Up utility (do it in order, specified in KB article).

Wednesday, October 10, 2007

How to create WCF service proxy without publishing mex endpoint #2

Important update to my previous article: if your service is defined inside of a namespace - you must specify the namespace using /serviceName option during the 1st step (WSDL and XSD creation).
Updated step #1 example:
svcutil /serviceName:MyNamespace.MyService MyServiceSvc.exe /reference:SomeReference.dll
If you'll miss specification of the namespace - resulting proxy code would be wrong (including even endpoing binding defintion).

Internet Explorer cannot open the Internet site - Operation aborted

I was affected by this issue and it took me some time to figure out what's the reason of it (in my case it was quite tricky). Generally - the reasons causing this error in IE are quite known. (Here are some for your reference :)

In my case it was a completely different story - it was caused by few IE DOM implementation bugs. Consider you have code on the IE client side that parses page body nodes and then removes them:

while (body && body.hasChildNodes()) {
var node = body.firstChild;
// ... app logic

Now consider that body content is created by Response.Write() on the server side (I write down some context in <p>...</p> paragraphs sections).
My application was working as a blaze, but occasionally I was getting "Internet Explorer cannot open the Internet site - Operation aborted" in IE. In Firefox it was never happen.
After some research I narrowed down the reason to the fact that body context is created by Response.Write and then I catched up what the problem was - it was related to the fact that on the server side I was writing body nodes in 4 steps:
1) ‘<p>’
2) app-specific content
3) ‘</p>’
4) Flush() output.

So - sometimes on the client side the code was running while paragraph weren't fully formed (e.g. only starting <p> was written).
In this case body.hasChildNodes() still returns true (IE bug #1) and body.removeChild(node) will cause "operation aborted" (IE bug #2).
As I noted - it's IE-specific and not happens in other browsers.

Fortunatelly - I had Response() bufferring turned off at the server side - o/w above problem would still happen, but with much lower frequency, making it very difficult to track it down.
The solution, as you may guess, is to write whole node at once on the server side...