Home > Articles > Programming > C#

This chapter is from the book

This chapter is from the book

Visual Studio 2012

Now that we’ve seen the hardcore way of building applications using plain old text editors and the C# command-line compiler, it’s time to get more realistic by having a look at professional tooling support provided by the Visual Studio 2012 products. Figure 3.15 shows the Visual Studio 2012 logo, reflecting the infinite possibilities of the technology.

Figure 3.15

Figure 3.15. The Visual Studio 2012 logo.

Since the very beginning of software development on the Microsoft platform, Visual Studio has been an invaluable tool to simplify everyday development tasks significantly. One core reason for this is its integrated development environment (IDE) concept, which is really an expansive term with an overloaded meaning today. Although it originally stood for the combination of source code editing and debugging support, today’s IDE has capabilities that stretch a whole range of features such as the following:

  • Source code editing with built-in language support for various languages such as C#, Visual Basic, F# and C++, including things such as syntax coloring, IntelliSense autocompletion, and so on.
  • Refactoring support is one of the powerful tools that makes manipulating code easier and allows for the restructuring of existing code with just a few clicks in a (mostly) risk-free manner.
  • Exploring code is what developers do most of their time in the editors. Navigating between source files is just the tip of the iceberg, with the editor providing means to navigate to specific types and members.
  • Visualization of project structures bridges the gap between architecture, design, and implementation of software. In the spirit of Unified Markup Language (UML), class designers and architecture explorers are available right inside the tool.
  • Designers come into play when code is to be generated for common tasks that benefit from a visual development approach. Typical examples include GUI design, web page layout, object/relational mappings, workflow diagrams, and so on.
  • Debugging facilities are the bread and butter for every developer to tame the complexities of analyzing code behavior and (hopefully not too many) bugs by stepping through code and analyzing the state of execution.
  • Project management keeps track of the various items that are part of a software development project, including source files, designer-generated files, project-level settings, and so on.
  • Integrated build support is tightly integrated with project management features and allows immediate invocation of the build process to produce executable code and feed build errors and warnings back to the IDE.
  • Source control and work item tracking are enterprise-level features for managing large-scale collaborative software development projects, providing means to check in/out code, open and close bugs, and so on.
  • Extensibility might not be the most visible feature of the IDE but it provides a huge opportunity for third parties to provide extensions for nearly every aspect of the tooling support.

Editions

I feel like a marketing guy saying so, but to “differentiate between the needs for various software development groups,” Visual Studio 2012 is available in different editions. For a full overview, we refer to the MSDN website, but here’s a short summary nonetheless:

  • Visual Studio Express Editions are free downloads targeted at providing rich tooling support to build great apps for the Web, the new Windows 8 platform, Windows Phone, as well as the classic desktop. Each edition comes with language support for C#, Visual Basic, and C++.
  • Visual Studio Professional Edition is aimed at the professional developer and at small teams. Compared to the Express Editions, it bundles the project types for all application types in one suite, also including support for development of Windows Services, cloud applications, and so on. In addition, rich tooling for testing is included.
  • Visual Studio Premium Edition extends the Professional Edition by adding tools for agile development teams, using Team Foundation Server (TFS). In addition, tools are included for project management, UI testing, code coverage analysis, lab infrastructure management, and much more.
  • Visual Studio Ultimate Edition is the largest edition available, and extends on the Premium Edition functionality by adding tooling for historical debugging (IntelliTrace), web performance and load testing, a richer unit test framework (Fakes), tools for architecture diagrams, and so forth.

In this book, we mainly focus on language and framework-level aspects of programming on the .NET platform, which are separate from the tooling support. However, when covering tooling support, we assume the reader has access to at least the Professional Edition of Visual Studio 2012. This said, many of the features covered (such as debugging support to name an essential one) are available in the Express Edition, too. From time to time, we’ll have a peek at Team System-level features, as well, but in a rather limited fashion.

Oh, and by the way, Visual Studio is available in different (natural) languages beyond just English. However, this book refers to the English vocabulary used in menus, dialogs, and so on.

Expression

Applications with GUIs, either for Windows or the Web, are typically not just built by development teams. An important peer to the developer involved in GUI development is a professional designer working on the look and feel for the application’s user experience.

Platform-level technologies like Windows Extensible Application Markup Language (XAML), Windows Presentation Foundation (WPF), Silverlight, and ASP.NET are built with this fact in mind, allowing for rich styling capabilities and a separation between developer code and UI definitions (for example, in terms of XAML). This very powerful concept enables developers and designers to work in parallel with one another.

Although this book focuses on the developer aspect of .NET application development, it’s important to know about the Expression family of tools that your designer peers can use. You can find more information about those tools at http://www.microsoft.com/expression.

Installing Visual Studio 2012

Installation of Visual Studio 2012 should be straightforward. If you are using at least the Professional Edition of the product, check boxes will appear to install managed code/native code development support (see Figure 3.16). Make sure to check the Managed Code option or switch the Options page to the more verbose mode where you can turn individual features on or off.

Figure 3.16

Figure 3.16. Visual Studio 2012 Professional installation options.

Depending on the number of features you select (I typically do a full installation to avoid DVD or other install media hunts afterward), installation might take a while. If you don’t already have those installed, various prerequisites, such as the .NET Framework, will get installed as well, potentially requiring a reboot or two. But it’s more than worth the wait.

Once Visual Studio setup has completed, install the product documentation, also known as the Help Library. Although the Visual Studio help system can hook up to the online version of MSDN seamlessly, it’s convenient to have the documentation installed locally if you can afford the disk space. To do so, go to the Start Menu and find the Manage Help Settings entry under the Visual Studio 2012, Visual Studio Tools folder. Figure 3.17 shows the user interface (UI) of this tool, where one can install content from the installation disk or by downloading it.

Figure 3.17

Figure 3.17. Visual Studio 2012 Documentation configuration.

A Quick Tour Through Visual Studio 2012

With Visual Studio 2012 installed, let’s take a quick tour through the IDE you’ll be spending a lot of your time as a developer in.

What Was Installed

Depending on the edition you have installed, a number of tools have been installed in parallel with the Visual Studio 2012 editor itself. Figure 3.18 shows the Windows 8 Start screen entry for Visual Studio 2012 for an Ultimate Edition installation on a 64-bit machine. (Obviously, users of previous releases of the operating system will find similar entries in the classic Start menu.) A few notable entries here are as follows:

Figure 3.18

Figure 3.18. Visual Studio 2012 Start screen entries.

  • Developer Command Prompt for VS2012 provides a command prompt window with several environment variables set, including additions to the search path to locate various tools such as the command-line compilers.
  • Remote Debugger is one of my favorite tools when debugging services or other types of applications that run on a remote machine. It enables you to enable debugging applications over the network right from inside Visual Studio 2012.

Another tool that was installed is ildasm.exe, the IL disassembler. Go ahead and use it to inspect the hello.exe assembly, looking for the Main method’s IL code. Because we’ll be using this tool from time to time, it’s good to know from where you can launch it.

Splash Screen and Start Page

Figure 3.19 shows the Visual Studio 2012 splash screen. Prior to Visual Studio 2010, the splash screen showed the different extensibility packages that were installed. Now this information is available from the Help, About menu.

Figure 3.19

Figure 3.19. Visual Studio 2012 splash screen.

The first thing you’ll see in Visual Studio is the Start page shown in Figure 3.20. It provides links to various tasks (for example, to reload recently used projects). An RSS feed shows news items from the MSDN website.

Figure 3.20

Figure 3.20. Visual Studio 2012 Start page.

Core UI Elements

The menu and toolbar contain a wealth of features. (We cover only the essential ones.) Make sure to explore the menu a bit for things that catch your eye. Because we haven’t loaded a project yet, various toolbars are not visible yet.

Various collapsible panels are docked on the borders. There are several of those, but only a few are visible at this point: Toolbox, Solution Explorer, and Error List are the ones we’ll interact with regularly. More panels can be enabled through the View menu, but most panels have a contextual nature and will appear spontaneously when invoking certain actions (for example, while debugging). Figure 3.21 shows how panels can be docked at various spots in the editor. The little pushpin button on the title bar of a panel can be used to prevent it from collapsing. As you get more familiar with the editor, you’ll start rearranging things quite a bit to adapt to your needs.

Figure 3.21

Figure 3.21. Customizing the look and feel by docking panels.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020