The opinions expressed in these materials are my own and are not necessarily those of Microsoft.
Copyright © Microsoft Corporation. All rights reserved. Unless otherwise indicated, all source code provided is licensed under the Microsoft Public License (Ms-PL).
The folks at Channel9 have created some video shorts on how to use many of the cool new features in Visual Studio 2012. You will most likely encounter links to the videos for the first time when you look at the “How-To Videos” section of the Start Page:
If you want another path to the videos you can find them all here (sorted by overall rating):
Also, links to these videos are now included throughout VS2012 RTM environment. For example, the IntelliTrace Everywhere video is linked inside the IntelliTrace tool window:
Here is the one on IntelliTrace Everywhere video you will see when you click on the link:
Take some time to explore these videos to get insight into ways you can leverage these amazing tools.
I started working with Azure almost five years ago and have been very happy to see it evolve and mature. If you are working with Azure or just learning how to use this offering then you need to start with Clint Edmonson’s “Windows Azure Solution Cookbook” found here:
Here is what this is all about in Clint’s own words:
“[…] it’s hard for architects and developers to get a big picture of the Azure platform and how all the features can be used together to build solutions. Microsoft is shipping new services on a quarterly basis and each new service is designed to solve a particular need our customers are asking for. We need a way to see these services holistically as a set of building blocks or ingredients to use in our solutions. […] In this series going to offer up some architectural recipes to help visualize solutions to the common scenarios we’ve identified since Azure’s launch.”
Don’t let the “architecture” word fool you. This is an exceptional view into how you can leverage Azure. For example, here is the overview pic that he provides for working with mobile:
Clint goes into clear, precise explanations about how you can achieve these goals. Make sure you take advantage of this most excellent look into using our latest and greatest Azure features.
Question: Can you upgrade Visual Studio 2012 RC to Visual Studio 2012 RTM?
Short Answer: Yes.
I’ve had several folks ask me about upgrading VS2012 RC to RTM recently. I thought it would be a good idea to review the upgrade paths.
In case you have been living in a cave, we have launched VS2012 RTM already:
Many people think you have to uninstall the RC but that isn’t true. You can find the full compatibility and upgrade information here:
Here are the verbatim pieces most relevant to upgrading with non-RTM information removed for clarity:
When following the supported upgrade paths, your Visual Studio source, solution, and project files will continue to work; however, you should expect to make some changes to sources. While we cannot guarantee binary compatibility between releases, we will do our best to document significant changes to assist you with updates.
On the off chance that you have to uninstall the RC you can find the instructions here:
Pay particular attention to the uninstall order if you have multiple VS2012 versions installed. Here is the order (top first, bottom last) to uninstall from the KB article:
For the first time in 25 years we are changing our logo. You can find our more from Jeffrey Meisner’s post here:
Just to remind you what the old logo looked like, here it is:
And now (drum roll please) the new logo:
We also have a cool video that shows some of our new logos that you can check out:
On August 13, 2012, Brian Harry announced that the Team Foundation Service (TFS in the Cloud) now has support for Kanban boards:
Support for on-premise Team Foundation Server 2012 should come with the first update post-RTM.
Here is a video about this new feature:
For those not familiar with Kanban, which was originally created for manufacturing, you can go here for a general overview:
As for Kanban and software development, I personally like this session from TechEd 2011:
On August 13, 2012, Brian Harry announced our new Team Foundation Server integration with Git. You can find his post here:
Why did we do it? Well, Brian himself says it best in his post:
“Distributed Version Control (DVCS) has a growing following. It enables a set of workflows that can be very handy and Git is an increasingly popular DVCS solution. Today, we are announcing Git-tf, a solution that enables you to work locally with a Git repo – edit, commit, revert, branch, merge, etc. and then “sync up” with a central TFS repository. In this way, you can have the best of both DVCS and TFS.”
This new effort is an open source one called Git-tf and you can find the project here:
The best part is you can run Git-tf on Linux, MacOS, or Windows
Here is a screenshot from the CodePlex site showing usage examples:
If you just want to download the bits and the getting started guide you can go here:
You should also check out this video that shows how the new features work:
If you find yourself having issues you can always check out StackOverflow for any Git-tf tagged items:
(Note: at the time of this writing there was only one entry in there so far)
The Visual Studio 2012 Virtual Launch Event is coming September 12! Make sure to add this free event to your calendar so you can attend. Just click the Add to Calendar link above to make sure you don’t miss out on some great stuff!
On August 15th we announced the availability of, both, Visual Studio 2012 and Windows 8.
You can find out more on our Visual Studio from Soma’s blog post here:
For those wanting to get their hands on the goods now here is an excerpt from the post:
For Windows 8, you can get details on the release here:
Here is the relevant part that deals with how to get your hands on the bits:
Depending on what Microsoft programs you or your organization might be part of, there are a few ways to get the RTM version of Windows 8. If you have an MSDN Subscription or a TechNet Professional Subscription, the RTM is available today. For info on other programs see the Windows 8 has reached the RTM milestone post on Windows Team blog.
If you are not part of one of these programs, don’t worry, we’re also offering a 90-day evaluation of the Windows 8 Enterprise edition for developers. This is available now from the Windows Dev Center download page along with Visual Studio Express 2012, Windows 8 design assets, code samples, and all the related tools and SDK’s you need to build apps.
If you use the evaluation version, we recommend installing it on separate drive or partition or in a VM. This way you’ll be able to upgrade from your original OS to the Windows 8 RTM when it becomes available in October. If you don’t, then you’ll need to reinstall from scratch when you decide to move to the full version. Make sure you read all the details on the download page.
Make sure to get your hands on these if you haven’t already and keep looking out for new series on my blog on the new Visual Studio!
I'll be on vacation until Aug 6th so there will be no posts until the week after I get back. We will resume our regularly scheduled posts at that point :)
In my travels across the country, with my fellow Evangelist, Clint Edmonson, talking about Visual Studio we often come across great stories to tell. One of our favorite true stories is of a customer that had a web application running very slow. We ran code metrics against it and, sure enough, the Page_Load event had 9,000 lines of code in it.
Naturally we were curious so we opened it up to see that it was basically the same if statement copied over and over. Apparently they needed to find out who was coming into the website in order to show customized content and the solution they came up with was this massive set of statements.
For better or worse we have all had code that gets copied throughout our solutions. Until now there was no tool to tell us there were copies and, instead, we had to rely on other metrics to hopefully reveal any code smells that lead us to duplicates. Now, however, we have the new Code Clone Detection (aka Code Clone Analysis) feature.
According to the documentation:
“Code clones are separate fragments of code that are very similar. They are a common phenomenon in an application that has been under development for some time. Clones make it hard to change your application because you have to find and update more than one fragment. Visual Studio can help you find code clones so that you can refactor them.”
You can find clones of specific code by selecting the segment you are interested then right click on the selection to choose Find Matching Clones in Solution from the context menu:
Visual Studio will search for code clones and produce the result in the new Code Clone Search Results window:
The original line of code is put in a group on its own and then all the matches are put into a different group. You can expand the groups to see the specific locations of the matches:
Also, you can double click on any entry in the list to go to the selection in your code file:
Besides looking for specific clones you can also look for code clones for the entire solution. To use this feature go to Analyze | Analyze Solution for Code Clones:
This creates a result set for the entire solution:
By default it groups and sorts the results by the strength of the match. Exact matches come first then those matches that may be close but not exact come next and so on. The terms you may see are Exact, Strong, Medium, and Weak.
Once you have the result set, there are a couple of ways you can compare them against each other.
If you have a comparison tool configured you can Right-click on any item and select Compare from the shortcut menu:
You would know if you have this feature available by going to Tools | Options | Source Control | Team Foundation Server and click on Configure User Tools.
If you don’t have a comparison tool you can do manual comparisons between two entries in the list. If the clones are in different files then you can just double-click each entry and it will open the file as well as highlight the entry that is duplicated as mentioned earlier.
You are probably curious as to what is found by this tool. The heuristics for finding clones will find duplicates even if the following changes have happened:
· Renamed identifiers
· Insert and delete statements added
· Rearranged statements
There are some rules for what is not found as well. I have taken this list from the documentation pretty much verbatim.
· Type declarations are not compared. For example, if you have two classes with very similar sets of field declarations, they will not be reported as clones. Only statements in methods and property definitions are compared.
· Analyze Solution for Code Clones will not find clones that are less than 10 statements long. However, you can apply Find matching clones in solution to shorter fragments.
· Fragments with more than 40% changed tokens.
· If a project contains a .codeclonesettings file, code elements that are defined in that project will not be searched if they are named in the Exclusions section of the .codeclonesettings file.
· Some kinds of generated code are excluded:
· *.designer.cs, *.designer.vb
· InitializeComponent methods
A settings file is available to configure this feature at the project level. Currently we have only announced the ability to do exclusions in the file but there will most likely be other elements that are added later on. The file is just XML with a .CODECLONESETTINGS extension. The only requirement for use is that the file exists in the top level directory of the project.
The base elements consist of a CodeCloneSettings element with an Exclusions child:
Within the Exclusions element you can have the following children:
This element is used to indicate files that should be excluded from analysis. Path names can be absolute or relative and you can use wildcards as well. So, for example, to ignore all the C# text template files that have been put in their own directory (called MyTextTemplates) you might have the following:
You can also exclude namespaces, types, and functions. Just like files these items can use absolute names or names with wildcards in them. Here is an example of what it might look like:
In the Tailspin Toys sample there is some generated code in the TailSpin.SimpleSqlRepository project that is the bulk of the duplications:
When I run code analysis, this is the result:
Code clone analysis doesn’t automatically know to ignore text templates so I would create an XML file called TailSpinRepository.codeclonesettings and insert an entry like this:
Now if I run clone analysis again here is what I get:
As you can see the results are significantly less than the first time the analysis ran. It’s common to create several exclusions in different projects to weed out noise in the analysis results.
Code Clone Detection is a great new tool to add to your arsenal for improving code quality. Combined with Code Analysis and Code Metrics, this will help quickly find potential issues.