May 10, 2011

Server Explorer is not responding in Visual Studio 2010 (as well?)

 

imagesCAZWHD7Q

 

I think this problem was present in the previous versions of Visual Studio as well, anyway, here is what happens:

1. You have some connections / servers in Visual Studio 2010 Server Explorer.

2. Something changes for example server was renamed / removed, or a connection no longer works, not quite sure what exactly should happen…

3. When you try to select the server or connection in server explorer in order to delete it, you get the Hourglass icon, you can’t do anything and waiting doesn’t help.

 

To resolve this, as I found in Google you may want to try this (Windows 7):

1. Close ALL instances of Visual Studio

2. Go to “C:\Users\your_user\AppData\Roaming\Microsoft\VisualStudio\version\ServerExplorer”

     Where your_user is your user and “version” is the version of Visual Studio, in my case, Donchev and 10.0.

3. Delete the file “DefaultView.SEView”.

Note: You may want to just edit the file, removing or changing problematic connections, I wanted my Server Explorer reset so I deleted the entire file, it is faster and safer.

May 9, 2011

Very old stuff – convert System.Drawing.Color to HTML.

When I was with Delphi, I wrote utility to do this myself (I mean Delphi in its early days) as I wasn’t aware for built-in mechanism to achieve that.

Now with .NET there is utility to do this for you but I often forgot which class has static method to convert System.Drawing.Color to Html string.

Here it is:

System.Drawing.ColorTranslator.ToHtml(color)

I think wouldn’t it be smarter to have an extender attached to System.Drawing.Color to do this for me from now on … :).