28 December 2010 0 Comments

Create Web Application or Virtual Directory in IIS

Keyboard:  SHIFT + ALT + N Menu:  File -> New Web Site Command:  File.NewWebSite Versions:  2008,2010 Published:  12/28/2010 Code:  vstipEnv0058   Did you know you can create Web Applications and Virtual Directories in IIS from inside Visual Studio?    Just go to File -> New Web Site and click on the Browse button:     Choose “Local IIS” and pick a web site you want to create the new item in:     In the upper-right corner of the dialog you will notice buttons:     One creates a Web Application:     The other a Virtual Directory:   You can pick which one you want to create and never have to leave Visual Studio.

18 December 2010 0 Comments

Format the Current Document or Selection (HTML Designer)

Keyboard:  CTRL + K, CTRL + D (document); CTRL + K, CTRL + F (selection) Menu:  Edit -> Advanced -> Format Document; Edit -> Advanced -> Format Selection Command:  Edit.FormatDocument; Edit.FormatSelection Versions:  2008,2010 Published:  12/18/2010 Code:  vstipEdit0089   In vstipEdit0057 ( http://blogs.msdn.com/b/zainnab/archive/2010/05/19/format-the-current-document-or-selection-vstipedit0057.aspx ) I showed you how to format code.  I thought it would be a good idea to look at the same thing from a web project perspective.  Let’s say you have some HTML you just wrote:   But you want to clean it up a bit.  Just select everything you want formatted, then RIGHT CLICK, and choose “Format Selection” (CTRL + K, CTRL + F):   Here is the result:   This uses the formatting rules found at Tools -> Options -> Text Editor -> HTML -> Formatting to determine what to do.

11 December 2010 0 Comments

Updating JScript IntelliSense

Keyboard:  CTRL + SHIFT + J Menu:  Edit -> IntellisSense -> Update JScript IntelliSense Command:  Edit.UpdateJScriptIntellisense Versions:  2008,2010 Published:  12/11/2010 Code:  vstipEdit0086   If you find that your IntelliSense isn’t showing items for JScript items you recently put in then you can update the JScript Intellisense yourself by going to Edit -> IntellisSense -> Update JScript IntelliSense or pressing CTRL + SHIFT + J:     It goes by pretty fast, but you may even see the “Updating JScript IntelliSense” message in the Status Bar at the lower left-hand corner of your screen:       When it is done, you should be able to see the newly added items in your IntelliSense.

9 December 2010 0 Comments

Display HTML/CSS Warnings as Errors

Menu:  Tools -> Options -> Text Editor -> HTML -> Validation Versions:  2008,2010 Published:  12/9/2010 Code:  vstipEdit0084   Normally HTML and CSS syntax problems will show up as warnings (green squiggles):   These also show up as warnings in the Error List window:     This means you can build and run the application if you choose to ignore the warnings.  You can choose to have these show up as errors instead if you want by going to Tools -> Options -> Text Editor -> HTML -> Validation and deselecting “as warnings”:     Now the green squiggles will be red:   And the previous warnings will show up as errors in the Error List window:

21 November 2010 0 Comments

Window Layouts: The Four Modes

Versions:  2008,2010 Published:  11/21/2010 Code:  vstipEnv0051   I recently had someone ask me why their windows seem to shift around when they go from Design to Debug mode.  The answer is simple:  Window Layouts.  You may have seen them if you have ever tried to export your settings.  It can be found under General Settings -> Window Layouts:       There are, in fact, four Window Layout modes in Visual Studio: Design View – this view is the one you see when you start up Visual Studio.  It’s what most people refer to as the “normal” view.   Debugging View – this is the view that you get when you enter Debug Mode like when you are stepping through your code.   Full Screen – the view you get when you go to View -> Full Screen (SHIFT + ALT + ENTER).

10 March 2010 0 Comments

Reuse the Same Editor Window When Opening Files

Versions Supported:  2008,2010 Menu Command:  Tools -> Options -> Environment -> Documents Tip Code:  vstipEdit0027   Normally, when you open up a new document it creates a new tab but you can just have the file open up in the current tab instead.  Let me illustrate:   Default (before):   Default (after):   But if you go to Tools -> Options -> Environment -> Documents and check the “Reuse current document window, if saved” option.  This is what happens:   Before:   After:   The caveat here is you have to have a “clean” (saved) document for this to work.  If the document was “dirty” (not saved) this would be the result even with this option turned on:   Before (note the asterisk to indicate the document is dirty):   After:

9 March 2010 0 Comments

Tricks with app.config and ClickOnce deployment (Saurabh Bhatia)

Storing settings in the config File The app.config file is used for many purposes and one of common uses is for storing application settings like connection strings. For example, you can store a string to the web service reference used by your application in the app.config file. The idea behind storing the string in the app.config is that you could simply replace the file and change the value of the string

7 March 2010 0 Comments

Turn on Line Numbers

Versions Supported:  2008,2010 Menu Command: Tools -> Options -> Text Editor -> All Languages -> General Tip Code:  vstipEdit0025 Line numbers are not on by default.  To turn on line numbers just go to Tools -> Options -> Text Editor -> General and check Line Numbers:

20 February 2010 0 Comments

Using CTRL + ALT + B to Open the Breakpoints Window — vstipDebug0011

  Versions Supported:  2008,2010 Keyboard Shortcut:  CTRL + ALT + B  Menu Command:  Debug -> Windows -> Breakpoints   Want to get the Breakpoints Window up fast?  Just use CTRL + ALT + B to open it up or, if it already open, to give it the focus.

18 November 2009 0 Comments

SF Bay.NET UG Tonight: Create a Custom Outlook Add-In using VSTO

If you’re in the Bay Area, come on out to downtown SF where Robin will be talking about Outlook Add-ins tonight. Create a custom Outlook Add-In using VSTO When :  Wednesday, 11/18/2009 at 6:30 PM Where : Microsoft San Francisco Office, 835 Market Street, Suite 700, San Francisco Visual Studio 2008 and Office 2007 made it easier than ever to create add-ins for Office

19 August 2009 0 Comments

Using the ReportViewer with ADO.NET Data Services and Entity Framework

The Winforms ReportViewer in Visual Studio Pro will allow you define client reports with a variety of data sources. If you’re not familiar with creating client-side reports using the ReportViewer, take a look at these videos: How Do I: Create a report from a database? How Do I: Create a report from a business object

18 August 2009 0 Comments

Visual Studio 2008 sales promotions

In case you’re still on the fence as to whether you want to upgrade your Visual Studio Professional Edition to a Visual Studio Team Edition (Architecture, Development, or Test) or Visual Studio Team Suite, how does saving 30% and 45% off when you step up from Professional Edition with MSDN Premium to either Team Edition or Team Suite respectively sound? If you go from Professional Edition to Team Edition Developer , you really are getting a lot for you money because you’ll also be getting Team Edition Database as well. With Developer, you get code analysis, unit testing with code coverage, application profiling, and code metrics for helping determine complexity and maintainability.