One of the questions I’m seeing coming across my desk more frequently is “How do I set my default browser to be the BlackBerry® Browser in Microsoft® Visual Studio®?”
The beauty of using the BlackBerry Web Plug-In for Microsoft Visual Studio is that it integrates seamlessly in with the development environment. What that means is that you would switch over to the BlackBerry simulator as your default browser the same way you would switch browsers if you were debugging a desktop site.
Before we get into the specific steps, I’d like to quickly go over what the Browse With button actually does and how it differs from debugging a website. When you set a browser using the Browse With functionality, and select to Browse the page immediately, you are actually using the preview version of the website so you won’t be hitting any of the breakpoints that you normally would. That’s an important concept to remember when using this feature, and something that I’m sure most web developers have done at some point before. In the Browse With window, there’s also an option to set the browser as your default browser. If you hit cancel after setting a default browser, that browser selection is still your default browser so you’re now able to debug using that browser.
So now let’s get into how you can set the BlackBerry Browser to be the default browser to debug your web application in. Assuming you already have a web application ready to debug, right click on the web application in the Solution Explorer and select “Browse With…”
Now select the BlackBerry Browser and click “Set as Default” (as shown in the first picture above). Next click on “Cancel” since we want to debug the site instead of run it in release mode. Now you should be back in the base Microsoft Visual Studio window. Since you’ve hit cancel on the Browse With window, your default browser will be set to the BlackBerry Browser however you won’t have any other browsers running, and you’ll be in coding mode in Microsoft Visual Studio.
To begin debugging, either push “F5” or from the debug menu, select “Start Debugging”.
This will launch the BlackBerry Smartphone Simulator, and you’ll be able to begin debugging your website.
I hope that answers some of the questions around the Browse With functionality and how to set the BlackBerry Browser to be the default browser when using Microsoft Visual Studio. Please feel free to leave any comments or questions below.