Debugging Vista Sidebar with Visual studio
Debugging Windows Vista sidebar with the help of Visual Studio is a difficult task. However, in this article, I will try to make this task easier by sharing my wealth of knowledge with everyone. In order to perform debugging, you will need to have Visual Studio installed. At present, Visual Studio 2005 is the latest version. Don’t use Beta versions. Also, you need to have a non-working Vista Gadget where you can perform the operation.
Important Step: Enable Script Debugging
First of all, you need to “Disable script debugging” from Internet Explorer’s Option Panel. Go to Internet Explorer’s Option Panel and Select the Advanced Tab. Uncheck "Disable script debugging".

Turn on this option after you have successfully debugged the Vista Gadget.
Second Step: Open the Gadget Code
After successful installation of the Gadget, Windows will unpack & copy the files to a folder in your user profile. Paste the following code into the address bar of windows explorer:
%LOCALAPPDATA%\Microsoft\Windows Sidebar\Gadgets
Press ENTER Key and you will find the names of Gadgets installed on your computer. Select the one that you want to debug and open the javascript file for the same in Visual Studio 2005.

Third Step: Attach to Sidebar Proces
Select “Attach to Process” option from the Tools Menu of Visual Studio 2005. Make sure the Gadget us running before performing this step. You can also press CTRL+ALT+P to open up the dialog window.

Search for “sidebar.exe” and click the Attach button to attach the process.
Final Step
This step is very important, so pay close attention to it. Click to set a breakpoint just to the left of the white area…
If everything works fine, you will be instantly taken to a new file that looks something like x-gadget:///main.js. After you hit the breakpoint, your debugging tool will immediately become active.
If you find problem while debugging any program in your windows, it may be due to a error in your registry database. To sort out these things you must have PCDOCPRO registry cleaner which scans all the junk files and repairs them to make PC safe.