Showing posts with label Visual Studio 2010. Show all posts
Showing posts with label Visual Studio 2010. Show all posts
  • Visual Studio 2010 Upgrade Tips Now for the caveats: If you move existing projects to Visual Studio 2010 from Visual Studio 2008 or 2005, your platform target is not updated. Visual Studio 2010 supports development targeting older framework libraries to aid in application deployment, but the project itself is altered to become a Visual Studio 2010 project and you won’t be able to open it in Visual Studio 2008. On the surface the changes are just version number changes in the project and solution files. Beneath the surface, there’s no guarantee that the structure of supporting files remains unchanged, so consider the move to Visual Studio 2010 a permanent one for your project, and keep backups in case you have a reason to revert. Changes to the workflow of data projects managed from Visual Studio (such as how you load scripts) are significant and may be confusing if you manage databases from Visual Studio.

    Visual Studio 2010 is a full rewrite. While it’s effectively a 1.0 product, overall performance and stability are adequate. But you’re much more likely to experience quirky behavior (such as the Clipboard ring sometimes not working as expected) and occasional crashes than in Visual Studio 2008.

    Pick up two or three tips a week from rereading this article, tip of the day sites, by having tips of the month at your local user group, or by exploring the menus and commands in the keyboard-mapping dialog. Consider buying Sara Ford’s “Microsoft Visual Studio Tips” (Microsoft Press, 2008). Ford’s book covers Visual Studio 2008, but almost all the tips also apply to Visual Studio 2010—and Ford’s donating her author proceeds to the Save Waveland Scholarship Fund, for Hurricane Katrina survivors in Waveland, Miss. Wherever you get your tips, the ones that make your life easier will stick and you’ll forget the ones that don’t. Visual Studio is a tremendously powerful tool that you can’t learn all at one time.

    Source of Information : Visual Studio Magazine August 2010

    more
  • Visual Studio 2010 Other Enhancements Visual Studio 2010 also has many miscellaneous improvements and support for libraries. The WPF designer is improved, and there’s a visual editor for the new Windows Workflow. XSLT gets a profiler and XSD gets a new designer. WPF and Silverlight get drag-and-drop data binding. ASP.NET gets many new features to support the vast improvements in development brought by jQuery and Model-View-Controller (MVC). The T4 code generator becomes a first-class citizen and a new style of T4 execution called preprocessed templates lets you generate code from apps outside Visual Studio, either with a standalone generator or your runtime application. Visual Studio 2010 embraces SharePoint development.

    Windows Azure Tools for Visual Studio 2010 support cloud development. There’s better support for other languages, including F# in the box, and snippet support for HTML and JavaScript. Whew! There are an amazing number of improvements, and I’m skipping the plethora of features resulting from the efforts in architecture, testing, database management and other areas that are reserved for the Ultimate version.

    Source of Information : Visual Studio Magazine August 2010

    more
  • Visual Studio 2010 Improved IntelliSense IntelliSense received improvements in Visual Studio 2010. Visual Studio evaluates what you type against the Pascal interpretation of appropriate symbols, similar to the Pascal interpretation in the Navigate To dialog, narrowing IntelliSense options. This allows you to find things quickly where you remember only part of the symbol, generally the relevant portion, ignoring any preceding words like “Is” or “Allow.” The abbreviations let you quickly enter the symbols you frequently use. IntelliSense is now filtered for the current target platform—Microsoft .NET Framework 4 features won’t appear in IntelliSense of a project targeting Microsoft .NET Framework 3.5.

    Previous versions of IntelliSense were awkward in a test-driven development (TDD) environment where the symbols do not yet exist. IntelliSense could be quite pushy, requiring frequent presses on the Esc key. Visual Studio 2010 offers a second mode for IntelliSense mode called suggestion mode. This mode assumes you may or may not be entering an existing symbol. The top of the suggestion mode IntelliSense box displays what will be entered if you close IntelliSense. You can use arrow keys or the mouse to select an existing item, or enter your text as written without IntelliSense interference:

    Visual Studio 2010 also provides TDD support through the Generate from Usage features. If you call to code that has not been created, you’ll get a compiler error because the symbol is not found. The error correction dialog now includes Generate from Usage options. The specific options available are based on the context. If it looks like a method, property or field, appropriate options are displayed. If it looks like a type, available options are creating a new class or a new type. Creating a new class will create a new file in your current project with an empty class using the symbol name. Creating a new type displays a dialog with many options for how the new type is created, including the project where it’s located. There are numerous improvements to debugging across all versions, but I think debugging deserves a future column to itself.

    Source of Information : Visual Studio Magazine August 2010

    more
  • Search Shortcuts in Visual Studio 2010 Beyond Navigate To and Call Hierarchy, Visual Studio 2010 doesn’t include new search features, but existing features are wildly underutilized. Beyond a simple search, you can Find in Files, Find Symbols, use F3 and Ctl-F3 for the next and previous, and use the quick find box in the toolbar. Find in Files lets you specify the directory to search and the file types. Find Symbols lets you limit your search by platform and create custom component sets for searching as well as supporting both prefix and substring searches. And you can use RegEx in many search dialogs. There are two additional keyboard search tricks. If you select a set of characters in your code and hit Ctl-F3 or Ctl-Shift-F3, you’ll navigate forward and back through any matches. If you press Ctl-I or Alt-I—depending on your keyboard layout—you’ll enter incremental search mode and the cursor will change to an arrow and binoculars. In this mode, Visual Studio will refine your search as you type, moving to the next matching value. You can also hit F3 or Shift-F3 to navigate to the next or previous matches. Hitting these keys also ends incremental search mode and places your search text into the quick search box for easy reference or reuse.

    Source of Information : Visual Studio Magazine August 2010

    more
  • Tweaks to the Editor with Visual Studio 2010 With previous versions of Visual Studio you could highlight a block by holding the Alt-Left mouse button and dragging. Now you have something useful to do with the block besides deleting it. Anything you type will simultaneously appear on all lines in the block. Outlining is improved in Visual Studio 2010. If you position over the vertical line representing the outline, the associated outline block appears shaded. If you click the line, this block collapses. You can also hide code within a method by selecting it, right-clicking and selecting Outline/Hide Selection. This can make it easier to understand complex methods—although breaking up complex methods remains a better strategy. Refactoring tools remain available in C# and through free third-party products for Visual Basic. The splitter in the upper-right corner of the edit window works a little differently in Visual Studio 2010. The cursor no longer changes when you pass over it, but you can still pull it down to see multiple locations in a single file within the same window. The left margin shows what files are changed. Yellow indicates changes that are not yet saved. Green marks lines that are saved, but don’t match the originally opened file—generally lines you can undo. A new orange color indicates lines that are the same as the original, but not yet saved. This generally happens when you undo back to the original, but an intermediate save means what’s saved doesn’t match what’s displayed.

    Source of Information : Visual Studio Magazine August 2010

    more
  • Better Navigation with Visual Studio 2010 Navigating between your open windows continues to improve with each version of Visual Studio. Ctl-Tab displays a navigable list of available windows and Ctl-F6/Ctl-Shift-F6 navigates through tabs. Ctl-Minus and Ctl-Shift-Minus now offer a slightly different behavior, which navigates only through text editor (code) tabs, skipping designers. You can access the drop-down list of open tabs with Ctl-Alt-Down, or if this fails, key map searching on “EzMdi.”

    Once dropped down, you can navigate to a specific tab either with the mouse or by typing the initial characters of the name. A subtle aspect of the drop-down is that the drop-down arrow changes when there are tabs out of view. The trick of navigating by typing the name also works when navigating in Solution Explorer. Windows themselves become more flexible in Visual Studio 2010. All windows can separate from Visual Studio, which is particularly useful when you drag them to a second monitor. Tool windows remain in a dockable state at all times, making rearrangement easier. The float option remains, but its purpose is to float a single item of a set of tabbed and docked windows. Dragging the title bar moves the set. In both cases, simply dragging to a dock location redocks, and dropping on a title bar adds to that tabbed set. Tool windows can now become tabs in the main window.

    Within a code window you can navigate backward and forward using the back and forward buttons or keyboard shortcuts (which differ by keyboard layout). The Navigate To dialog box is new to Visual Studio 2010 and can be accessed via the Edit menu or a shortcut key. This feature has sometimes been called “Quick Search.” It allows navigation to any symbol (such as a type or method) in your project and is cached for very fast performance.

    The search is based on a Pascal-style search, which assumes every capital letter or underscore in your symbol name delimits a word you might search on. A special trick is to include a space in your search string to find two different word parts based on a partial search. For example, “bi att” finds BizServiceAttribute and BizObjectAttribute. If you type capital letters, Visual Studio 2010 will evaluate them as an abbreviation, so BSA will also retrieve BizServiceAttribute as one of the matching options. This new dialog is especially useful when you’re not quite sure of the name. It enhances the benefits of good, semantic, multipart naming.

    The Visual Studio 2010 editor has a feature that at first glance may seem a little odd. Hovering the cursor over a symbol highlights all matching symbols. This illustrates how symbols are used, particularly if you temporarily zoom out. What’s cool is you can navigate between the highlighted words using Ctl-Shift up and down arrows. If you don’t like this feature, you can turn it off in the Tool/Options page for each language.

    C# and C++ have a special navigation feature called Call Hierarchy. Call Hierarchy allows exploration and navigation based on the ways methods are used, jumping to call sites and to called members. While this has some similarities to the runtime callstack, it’s available at design time and shows all potential paths, not just the single, currently executing path. Call Hierarchy is an extremely valuable tool. Hopefully, Visual Basic will support Call Hierarchy in the next version.

    Source of Information : Visual Studio Magazine August 2010

    more
  • Updated Project Dialog in Visual Studio 2010 Once you’re ready to start a project, you’ll find an updated New Project dialog, where I’ve delineated the most easily overlooked features. You can finally search and sort items in this dialog! The search evaluates all available projects so you’ll see C# and Visual Basic projects both displayed. If you’d like to narrow it down to a particular project type, add C# or Visual Basic as a separate word at the end of your search string. The previous word doesn’t need to be complete; for example, “cl c#” finds the C# Class Library, C# Silverlight Class Library and several other project types.

    You can select the target platform in the New Project dialog. If you develop Windows Presentation Foundation (WPF) or Windows Forms applications, you might be surprised to find the default target platform for Visual Studio 2010 is the Client Profile. This is a subset of the full Microsoft .NET Framework platform designed for faster and smaller installation. In most cases, this is a good choice for your application, but be prepared to change it if you’re missing aspects of the framework that you need. If you’ve seen a demo of Visual Studio 2010, you’ve probably seen zoom via the scroll wheel or control-shift-comma and period. It’s a flashy and easily misunderstood feature. Similar to Excel zoom, only the current tab zooms. The zoom doesn’t “stick.” The intention is not to change your font size overall, such as for a presentation, but to allow different views of different windows and at different times. You can zoom out to get the big picture or zoom in to see the details of your code.

    I frequently want to change the font size for all of my text editor windows when I move from my external monitor to laptop screen, hook up to a projector, pair with someone, or when my eyes are just having a bad day. You can map a key to increase or decrease your font size for all of your code windows using an accessibility macro. Search keyboard mappings for “fontsize,” and you should find Macros.Samples.Accessibility.DecreaseTextEditorFontSize and its parallel InCreaseTextEditorFontSize. I map these to Alt-Minus and Alt-Equals, which are easy for me to remember. You can do this in Visual Studio 2008 and Visual Studio 2010.

    Source of Information : Visual Studio Magazine August 2010

    more
  • Personalize Your Layout in Visual Studio 2010 Stop by the Fonts and Colors dialog, particularly if you do presentations. The default for selected text is difficult for some people to read, especially on some projectors. You can change this in any version of Visual Studio by selecting Text Editor/Selected Text and choosing black on a pale background such as yellow or a custom color. My eyes appreciate increasing the size of the small fonts used by default in tool windows and IntelliSense.

    The Keyboard tab allows powerful personalization of your experience. You can set keystrokes for your favorite features, remap the keystrokes that you have trouble remembering, or map keystrokes to macros for truly custom behavior. You can also use the search feature of the keyboard dialog to see if a particular command is already mapped to a standard key in your keyboard layout. The keyboard-mapping page even allows exploration of what commands are available inside Visual Studio. A major improvement in Visual Studio 2010 is that right-click context menus now display mapped keystrokes.

    If you’re a Visual Basic developer, consider how you want Ctl-Y to behave. The Visual Basic keyboard mapping retains the historic Cut Line behavior. However, programs from Office to Finale Notepad use Ctl-Y as the shortcut for Redo. With such a drastic difference in meaning, you might want to remap this key.

    Other helpful settings in Visual Studio 2010 and Visual Studio 2008 include line numbers, save a new project when it’s created, open .XAML files in XAML View to avoid the designer delay, redirect debugger output to the Immediate window, or quiet the warning when files are modified outside the IDE by Expression Blend or external generation. Visual Basic programmers may want to select Option Strict for new projects to create a strongly typed experience by default.

    In Visual Studio 2010 you can insert new tabs to the right of existing tabs for more consistency with programs like Internet Explorer. If you don’t like something that’s new in 2010, you can probably turn it off. Look for a “Show All Settings” checkbox at the bottom of the Options dialog if you chose Visual Basic as your development style. You can adjust your settings with confidence because if you mess things up entirely, you can reset it all in the Import/Export settings tab. You can also export settings for specific environments like pairing.

    Source of Information : Visual Studio Magazine August 2010

    more
  • IntelliTrace Debugging in a Nutshell IntelliTrace is a new debugging technology introduced in Visual Studio 2010 Ultimate. It’s based around low-overhead collection of debugger state at specific event points, exceptions, debugger stopping events and method enters and exits. From F5 debugging a user can move back in time to previous data collection points to examine collected data. In addition, the collected IntelliTrace file can be shared and the debugging session replayed on different machines.

    When applications act up, you can break debugging and view the IntelliTrace events window. You’ll often see exceptions being thrown and caught that point to a possible issue or internal Microsoft .NET Framework calls that help convey what various frameworks are doing below the covers.

    In the IntelliTrace options menu, a wide variety of IntelliTrace events can be configured for collection. These events were selected to cover a broad range of application types such as Windows Forms, ASP.NET and ADO.NET. A set of useful parameters has been selected for data collection at each event. With its ability to integrate with Microsoft Test Manager and save and debug from iTrace files, IntelliTrace can help close the “no repro” gap between developers and testers. A bug with an iTrace file attached is far more actionable for a developer. By integrating IntelliTrace into your testing workflows, you’ll improve life for both developers and testers.

    By turning on the IntelliTrace calls information mode, data on method parameters and return values will be collected at all function enters and exits. This mode also provides several navigation features, such as searching for IntelliTrace results from source files and backward stepping to move between data collection points.

    Source of Information : Visual Studio Magazine August 2010

    more
  • Multi-Core Processors with .NET 4 and Visual Studio 2010 If you want to take advantage of the power of multi-core machines, you need to start creating applications with parallel processing using PLINQ, the Task Parallel Library and the new features of Visual Studio 2010.

    The old rule was, if you wanted to create a program with bugs that you could never hope to track down, you wrote it as a multithreaded application. All that has changed, thanks to the introduction of Microsoft Parallel Extensions for .NET, which provides a layer of abstraction on top of the Microsoft .NET Framework threading model.

    Parallel Extensions follows the model Microsoft established with the transaction manager in COM applications and with the Entity Framework and LINQ in the area of data access. Parallel Extensions attempts to bring a sophisticated technology to the masses by building high-level support for a complex process into the .NET Framework. With multi-core processors becoming the norm, developers crave the ability to distribute their applications over all the cores on a computer.

    You can access the power of Parallel Extensions either through Parallel LINQ (PLINQ) or through the Task Parallel Library (TPL). Both allow you to write one set of code for single- and multi-core computers and count on the .NET Framework to take maximum advantage of whatever platform your code eventually executes on, while protecting you from the usual pitfalls of creating multithreaded applications.

    PLINQ extends LINQ queries to decompose a single query into multiple subqueries that are run in parallel rather than sequentially. TPL allows you to create loops with iterations running in parallel rather than one after another. While the declarative syntax of PLINQ makes it easier to create parallel processes, TPL-oriented operations will be, in general, more lightweight than PLINQ queries. In many ways, though, choosing between TPL and PLINQ is a lifestyle choice. If you think in terms of parallel loops rather than parallel queries, it can be easier for you to design a TPL solution than a PLINQ solution.

    Source of Information : Visual Studio Magazine August 2010

    more