Windows is trying to configure Visio upon Application Start-up

Standard

This post is not related to anything programming :) In my system, when launching Visio, the application will pause while displaying “Please wait while Windows configures Microsoft Visio”. And after sometime, it shows the main window.

Windows is trying to configure Visio

Windows is trying to configure Visio

I tried repair, but it was not working. Today I found a similar Microsoft Support article – 2685120. And the solution worked for me :)

This can be caused by the [HKEY_CLASSES_ROOT\.vsd] key not being equal to “Visio.Drawing.11″ or equal to “VisioViewer.Viewer” if you have Visio Viewer Installed. To fix this error, change the value to “Visio.Drawing.11″ or “VisioViewer.Viewer”.

But still I will say, Happy Programming :D

Verify Internet connection is available using C#

Standard

While reviewing some code, I found a snippet for checking internet connection, like this

private static bool IsConnectedtoInternet()
{
	bool IsConnectedtoInternet;
	try
	{
		using (WebClient client = new WebClient())
		{
			using (client.OpenRead("http://www.microsoft.com"))
			{
				IsConnectedtoInternet = true;
			}
		}
	}
	catch
	{
		IsConnectedtoInternet = false;
	}
	return IsConnectedtoInternet;
}

I found this way of internet connection availablilty many times, but most of the times it was google.com :) So I thought of writing the correct way (at least from my prespective) of verifying internet connection. For this I am using a WIN32 API, InternetGetConnectedState method, from wininet.dll. And here is the snippet.

[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState
    (out int Description, int ReservedValue);
private static bool IsConnectedtoInternet()
{
    int description;
    return InternetGetConnectedState(out description, 0);
}

Happy Programming :)

IIS Express Webserver Here – Shell Extension

Standard

If you have installed mono, mono comes with a web server called XSP. One of my favorite feature of XSP (or mono) is you can right click on any folder and start a website with that folder as the physical path. And if you are downloading lot of sample code and application; every time hosting the application in IIS is a tedious job. Here is a simple Windows Explorer shell extension, which will help you to right click on a folder and Start IIS express (IIS Express, a lightweight version of IIS, is available as a standalone freeware server and may be installed on Windows XP with Service Pack 3 and subsequent versions of Microsoft Windows. IIS 7.5 Express supports only the HTTP and HTTPS protocols. IIS Express can be downloaded separately or as a part of Microsoft WebMatrix.).

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\folder\shell\IISExpressHere]
@="IIS Express Webserver Here"
[HKEY_CURRENT_USER\Software\Classes\folder\shell\IISExpressHere\command]
@="cmd /c start /D\"C:\\Program Files\\IIS Express\\\" iisexpress.exe /port:%%random%% /path:\"%1\""

Code Explained

Line #1- Registry Editor Version – RegistryEditorVersion is either “Windows Registry Editor Version 5.00″ for Windows 2000, Windows XP, and Windows Server 2003, or “REGEDIT4″ for Windows 98 and Windows NT 4.0. The “REGEDIT4″ header also works on Windows 2000-based, Windows XP-based, and Windows Server 2003-based computers.
Line #2, #3- This will create a context menu item with text – “IIS Express Webserver Here”
Line #4 – This will associate a command to the above created menu item.
Line #5 – Start IISExpress.exe from the location, with a Random port (%RANDOM% – will return a random number). And %1 will be the selected folder.

Create a file with “.reg” extension, copy paste the code and save. Double click on the reg file. You may get UAC dialog and a security warning from Registry editor. Once you successfully merged the changes, you will get a context menu item like this, which will start IIS Express.

IIS Express Webserver Here - Shell Extension

My Environment is Windows 7 x64 bit system. Please modify the script according to your environment.

Caution: Incorrectly editing the registry may severely damage your system. Back up the current version of the registry before making any changes. You should also back up any valued data on the computer.

How to uninstall Internet Explorer 9

Standard

Due to some VPN connectivity issues, today I had to rollback my IE installation, and I couldn’t find it in the control panel, Add or remove programs. I deselected the check box in Windows Programs and Features dialog, but it removed the Internet explorer from my computer. Later I found the solution in Microsoft website. These are steps required to uninstall IE9.

  • Open Programs and Features from Control Panel.
  • Select View Installed Updates from left side
  • Under Uninstall an update, scroll down to the Microsoft Windows section
  • Right-click Windows Internet Explorer 9, click Uninstall, and then, when prompted, click Yes. And restart the computer. It will un-install IE9 and install IE8.

Happy Coding :)