My Gadget Doesn't Work!

In my earlier post about creating gadgets, I mentioned Visual Studio debugging and what to do if your gadget doesn't work. Let's start with the latter and then move on to the more general case of how to debug script in Visual Studio...

What should I do if my gadget doesn't work?

A few troubleshooting tips:

  • Gadget doesn't load
    • Browse direct to the manifest URL you're using - the manifest XML should be returned
    • Copy and paste the URLs for the .js and .css files from the manifest into your browser address bar - make sure both get returned
    • At this point at least we're confident that you're correctly pointing to the manifest which in turn is correctly pointing to the .js and .css files
    • And remember, when you "deploy" your gadget you need to update the manifest to point to the URLs - this is easy to forget.
    • [I create multiple manifests, deploy the gadget and simply reference the correct one. eg a gadget_localhost.xml manifest and a gadget_remote.xml manifest] If you're running from localhost, have you added https://*.start.com and https://*.live.com to your trusted sites in IE?
    • There can be some funny caching issues in Live.com so I use the following method when I want to test a new version of a gadget
      • Start IE and browse to live.com
      • Remove any instances of the current gadget (both in the main page and in "My Stuff"
      • Close the browser
      • Start IE again and browse back to live.com
      • Remove any instances of the current gadget
      • Add the new version as usual ("Add Content" etc).
      • You should get the warning etc and the option to install the gadget. Check the URL is correct!
      • Go ahead and install and the new version should be available
  • Gadget throws an exception or doesn't do what I expect
    • Realistically, we're into standard debugging techniques here whether that's doing the equivalent of Debug.Print or stepping through code
  • Gadget doesn't look the way I expect it to
    • Are the CSS styles being applied?
    • Double check the URL to the CSS file
    • Make sure you have the ".namespace_classname" selector before each selector in your CSS file

Well I hope that's something of a starting point. Next, how to set yourself up for Visual Studio script debugging...