Install Published Samples with Visual Studio

Install Published Samples with Visual Studio

Rate This
  • Comments 7

You can use Visual Studio 2012 RC  to download and install samples from the MSDN Code Gallery.  You can download only the samples you need, or you can download one or more Sample Packs, which group several samples that relate to a technology or topic. You'll receive a notification if source code changes are published for any sample that you download.

To locate the samples, open the New Project dialog, and then expand the Online tab, and then the Samples node.

To locate the sample packs, choose Tools, Extensions and Updates on the menu bar. In the Extensions and Updates dialog box, expand the Online tab, and then expand the Samples Gallery node. After you install a sample pack, you can install the individual samples from the Installed tab of the New Project dialog box.

Working Copy and Master Copy

When you install an online sample, the solution is stored in two locations:

    • A working copy is stored in the location that you specify by using the New Project dialog box.
    • A separate master copy is stored on your computer.

After you install a sample, it appears on the Installed tab of the New Project dialog box. You can create new working copies from the master copy without remembering where you found the sample on the web and without being connected to the Internet.

If a sample is no longer useful, you can remove the master copy from the Extensions and Updates dialog box, which you can open by choosing Tools, Extensions and Updates. Removing the master copy doesn't remove any working copies that you created.

You'll receive a notification if source code changes are published for an installed master copy of a sample. The notification will appear in both the Windows notification area when Visual Studio is open and on the Updates tab of the Extensions and Updates dialog box. If you update a sample, you'll replace the master copy but not any working copies.


Installing a Sample

  1. To install a sample, choose File, New, Project.  In the New Project dialog box, expand the Online tab, and then expand the Samples node.
  2. Find the samples that you want by opening the nodes for the programming language, the platform, and the technology and then choosing the topic.  Or you can use the Search Installed Samples box in the top-right corner. Choose a sample that you want to install.
  3. For the Name, specify a name for the first working copy of the sample.  When you install the sample, the Name will become the name of the folder and the name of the solution file. Names of other files in the working copy will stay the same as those in the master copy. The Name doesn’t apply to the master copy.
  4. For the Location, specify a folder.  The location is where the working copy, not the master copy, will be installed. Note that the default value is a Samples folder and not a Projects folder.
  5. Click OK.  If you agree with the license terms, click Install.  A working copy of the solution is stored in the location that you specified, and a separate master copy is stored on your computer.

You can open a working copy of an installed sample by using the Open Project dialog box. Note that the default location for the working copy was the Samples folder, not the Projects folder.


Managing the Master Copy of an Installed Sample

  1. You can create a working copy of an installed sample from its master copy, or you can disable or uninstall the master copy.  Let's look at two dialog boxes where you can access the master copy.
  2. Open the New Project dialog box, then expand the Installed tab, and expand the Samples node.  Expand the nodes for the programming language, the platform, and the technology, and then choose the topic.
  3. The master copies of the samples that you've installed appear.  Double-click a sample to create a new working copy.  On the Installed tab, you can create working copies from the master copy without remembering where you found the sample on the web or being connected to the Internet.
  4. Close New Project dialog box and open Tools, Extensions and Updates.
  5. In the Extensions and Updates dialog, choose the Installed tab, and then expand the Samples node.  The master copies of the samples that you've installed appear.  You can disable or uninstall master copies without affecting any working copies that you've created.
    Note that if source code changes have been published for any sample that you installed, a notification appears on the Update tab. For each update listed, you can choose the Update button to update your master copy.


Installing a Sample Pack

  1. Choose Tools, Extensions and Updates.  In the Extensions and Updates dialog box, expand the Online tab, and then expand the Samples Gallery node.
  2. Find the sample pack that you want by using the Search Samples Gallery box in the top-right corner or by expanding the nodes for the programming language, the platform, and the technology and then choosing the topic.
  3. Choose a sample pack, and click Download.  If you agree with the license terms, click Install.  The sample pack is installed on your computer, but working copies of the samples haven't been created. 
  4. Close Extensions and Updates and choose File, New, Project.  In the New Project dialog, expand the Installed tab, and then expand the Samples node.  Browse the nodes or use the Search Installed Samples box in the top–right corner to find the samples that you installed.  Double-click the sample to create a new working copy of that sample.


For more information, see A World of Samples at your Fingertips.

Thanks to Anthony Cangialosi for providing technical information.

Leave a Comment
  • Please add 1 and 2 and type the answer here:
  • Post
  • Yes, but does the sample project name show up in all caps?

    Sorry, couldn't resist that.  This system sounds very cool.

  • Look, I have to know from you guys! Is VB.NET ALSO dying like VB6??? I started learning VB with VB6 back in 2002 and loved the language. When VB.NET came out I thought it was heaven on earth. But then I keep seeing more and more C# developers and C# jobs than VB.NET developers or jobs. In fact, I have had to take a C# developer role because there are no more VB developer roles in the market! In fact, VB developers have become sort of a joke in the developers community!!

    WHY!?? WHY on Io/Earth/Jupiter/Mars is Microsoft giving this step-motherly treatment to the VERY language that SPAWNED the .NET Framework?? I mean VB is coming out with a version 11 now while C# is still in version 4 or 5 or so! VB should have MORE support than C#, and anyway don't tell me that Microsoft is STILL trying to woo Java people away by providing a C++ type language!! Enough people have come over to Microsoft programming anyway!

    So why is VB dying????

    Would really appreciate some insight into this!

  • this helps me much,

    thanks.

  • Hello ,, how.can i get those samples ???

  • Good post, thanks for this.

  • Where are these samples stored.

    I want to re-install Windows 8 and vs2012  

    I got backup of all my projects but where are the samples and extensions installed ?

  • "A separate master copy is stored on your computer."

    Where?!? I have spent the better part of 2 hours trying to figure out where to save the WDK samples so they appear in the new project wizard. Nowhere that I have found actually says where to download them to!

Page 1 of 1 (7 items)