Terje Sandstrom

------ Chief Software Geek at Inmeta Consulting in Scandinavia ----- and a Visual Studio ALM MVP

  Home  |   Contact  |   Syndication    |   Login
  47 Posts | 1 Stories | 66 Comments | 0 Trackbacks

News

Subscribe

Visual Studio Feeds

Twitter












Tag Cloud


Article Categories

Archives

Post Categories

Image Galleries

Company stuff

Interesting bloggers

Interesting companies

Microsoft

Microsoft Norge

Microsoft Regional Directors

Microsoft Test

MSFT Blogs

MVP

NNUG

Other interesting stuff

TFS

Visual Studio

Tuesday, April 2, 2013 #

Looking for the VS 2010 extensions ? Go to extensions for VS 2010. Looking for links to the test adapters, go to this blog post.

UPDATE Apr 15th 2013:  Added links to the different versions of the TFS Power Tools

UPDATE Apr 12th 2013: Updates: Code ContractsCode Contract Editor Extensions, T4 Toolbox 

UPDATE Apr 4th 2013: Updates: Visual Studio 2012 Update 2 ,TFS 2012 with Update 2, and Productivity Power Tools 2012

UPDATE Apr 2th 2013: Visual Studio 2012 Update 2 CTP 4, added T4 Toolbox, Code Contract Editor Extensions, updated Visual Studio Tools for Git , TypeScript, ReSharper, NuGet Manager, Wix Toolset (Version 3.7), Productivity Power Tools, Code Contracts, Slow Cheetah, Web Essentials

UPDATE Feb 5th 2013: Hotfix for TFS 2012 Update 1, update of Slow Cheetah

UPDATE Jan 31th 2013: Visual Studio 2012 Update 2 CTP 2, VS 2012 extension for Gitsupport, small update of Community Build Manager , updated NDepend and ReSharper

UPDATE Dec 17th 2012: Added Productivity Power Tools, remove Power Commands. Update of NDepend, NuGet.

UPDATE Dec 10th 2012: Visual Studio 2012 Update 1, TFS 2012 with Update 1, and LinqPad added, updates on ReSharper, TypeScript, TFS Power Tools, Build Manager, Code Contracts,Visualization and Modeling SDK, Slow Cheetah, Web Essentials, Just Decompile and tangible T4 editor

UPDATE Oct 31th 2012: Typescript added, Visual Studio Update 1 CTP4 added, NuGet updated

UPDATE Sept 16th 2012: New TFS Power Tools, NuGet updated

UPDATE Sept 12th 2012: New version of Code Contracts

UPDATE Sept 10th 2012: Added Slow Cheetah, WiX 3.6 released

UPDATE Aug 31th 2012: Updated for RTM

UPDATE June 17th 2012: New versions of Feedback Tool and SDK for the RC.

UPDATE May 30th 2012: Visual Studio 2012 and TFS 2012 RC released. Updated names to 2012.

UPDATE April 8th 2012: April Update of Visual Studio 11 Beta. Added Code Contracts - released for Dev 11. New version of NuGet Manager

This post is a list of the extensions I recommend for use with Visual Studio 2012. It’s coming up all the time – what to install, where are the download sites, last version, etc etc, and thus I thought it better to post it here and keep it updated. The basics are Visual Studio 2012 connected to a Team Foundation Server 2012.

Many live in a side-by-side environment with Visual Studio 2010. The side-by-side is supported by VS 2012. However, if you installed a component supporting VS2012 before you installed VS2012, then you need to reinstall it. The VSIX installer will understand that it is to apply those only for VS2012, and will not touch – nor remove – the same for VS2010. A good example here is the Power Commands.

The list is more or less in priority order.

The focus is to get a setup which can be used for a complete coding experience for the whole ALM process.

The list of course reflects what I use for my work , so it is by no means complete, and for some of the tools there are equally useful alternatives. Many components have not yet arrived with VS2012 support. I will add them as they arrive.

The components directly associated with Visual Studio from Microsoft should be common, see the Microsoft column.

If you want to use the same set of extensions on multiple computers, you might like to share them easily. Lars Wilhelmsen has a great blog post about how to use Dropbox to share extensions and common settings.

Components ready for VS 2012, both upgrades and new ones

Product Notes Latest Version License Applicable to Microsoft
Visual Studio Tools for Git1 See Brian Harry’s blogpost 0.8.0.0 Pre-release Visual Studio Yes
TypeScript See info here, and B.Harry’s blogpost. Codeplex here 0.8.3.1 Free Coding Yes
ReSharper3 7.1.25.234 (.2000.1478) Licensed Coding & Quality No
NuGet Manager1 3 Initial install included with VS 2012. Updates through extension gallery 2.2.40116.9051 Free Visual Studio Yes
TFS Power Tools1
(This applies to Update 1)

TFS Power tools (This applies to RTM)
See Brian Harry’s blog post for more info
(Side-by-side with TFS 2010 should work, but remove the Shell Extension from the TFS 2010 power tool first.), and this post for info on Update 1
To support Update 2, install TFS Power Tools Update 1 BEFORE you upgrade to Update 2. New version ETA end of April)
Nov 2012(11.0.51126.0) Free TFS integration Yes
NDepend3 Info on updates here. Trial available.

4.1.0.6871

Licensed Quality No
Build Manager1 Community Build Manager. Info here from Jakob 1.4.0.9 Free TFS Integration No
Visual Studio 2012 SDK Required for using Wix Published 2.Aug.2012 Free Visual Studio Yes
Wix Toolset 3.7 Free Coding/Installers No
Visual Studio 11 Feedback tool1 Use this to really ease the process of sending bugs back to Microsoft. 1.2.3 Free Visual Studio Yes
Productivity Power Tools1 Re-added with new features, now also includes Power Commands, which can be uninstalled. 11.0.60403.0 Free Visual Studio Yes
Power Commands1 3 Just reinstall, even if you already have it for VS2010. The reinstall will then apply it to VS 2012
Install Productivity Power Tools which includes Power Commands
1.0.2.3 Free Coding Yes
Code Contracts1 3 Now on gallery too. Info here and follow the forum here
1.4.60409.11 Free Coding Yes
Code Contract Editor Extensions1   1.5.60409.11 Free Coding Yes
Visualization and Modeling SDK Requires VS 2012 SDK
RTM (Sept. 29th 2012) Free now, otherwise Part of MSDN Subscription Modeling, DSL, UML extensions Yes
Slow Cheetah1 Tool for transforming XML files, like config files. 2.5.5 Free Coding No
Web Essentials1 2.6 Free Coding Yes
ILSpy Decompiler. Can also export assembly as C# project 2.1.0.1603 Free Coding/Investigation No
DotPeek   1.0.0.8644 Free Coding/Investigation No
Just Decompile   2012.3.1016 Free Coding/Investigation No
T4 Toolbox1 11.5.0 Free Coding (T4 templates) No (Author now MSFT)
tangible T4 editor1   2.1.1 Lite version Free (Good enough) Coding (T4 templates) No
LinqPad Info here 4.43.06 Free and licensed versions Coding No

#1 Get via Visual Studio’s Tools | Extension Manager (or The Code Gallery). (From Adam : All these are auto updated by the Extension Manager in Visual Studio)

#2 Works with ultimate only

#3 Also works with VS 2010

Components we wait for, not yet in a VS 2012 version

Product Notes Latest Version License Applicable to Microsoft
Inmeta Build Explorer     Free TFS integration No

Components which are now integrated into VS 2012

Product Notes
Fakes Was Moles in 2010. Fakes is improved and made into a product.
NuGet Manager Included in the install, but still an extension package. Info here. So it is updated through the extension manager. Initial version is 1.6.30117.9648

Product installation, upgrades and patches for VS/TFS 2012

Product Notes Version number Date Applicable to
Visual Studio 2012 Update 2
and
TFS 2012 with Update 2
See Brian Harry’s blogpost and MSDN Blogpost
Also see links to other updates in the VS 2012 Update 2 page
11.0.60315.01
2012.2
Apr 4th 2013 VS and TFS
VS2012 Update 2 CTP 4 See KB2797912 and 11.0.60223.1 Mar 3rd 2013 VS and TFS
VS 2012 Update 2 CTP 2 See Brian Harry’s blogpost and KB2797912 11.0.60115.01 Jan 30th 2013 VS and TFS
Hotfix 1 for TFS Update 1 See Brian Harry’s blogpost, and KB2803625 11.0.60123.0 Feb 1st 2013 TFS
Visual Studio 2012 Update 1 You should find it as a product update in the Extension Manager.
Info from Brian H here, and other info here ( and here written for CTP4 but valid). Also see all downloads from here.
11.0.51106.1
2012.1
Nov 26th 2012 Visual Studio
TFS 2012 with Update 1 Complete install or upgrade from RTM. 11.0.51106.1 Nov 26th 2012 TFS
Visual Studio 2012 Update 1 CTP 4 11.0.51020.3 Oct 29th 2012 Visual Studio and TFS
Visual Studio 2012 & TFS 2012  

11.0.50727.1

Aug 15th 2012 Visual Studio and TFS
July 2012 Update

11.0.50626.1

July 2012 Visual Studio and TFS
Visual Studio 2012 & TFS 2012 RC See Brian Harry’s blogpost, more links inside there 11.0.50522.1 May 31th 2012 Visual Studio and TFS
April 2012 Update1 See KB2677574 and VS Blogpost for more information.
Get the update using Tools/Extension Manager/Product Update.
11.0.50323.1 April 2012 Visual Studio
Visual Studio 11 & TFS 11 Beta This is the beta release, and you are free to download and try it out. 11.0.50214.1 March 2012 Visual Studio and TFS
SQL Server 2008 R2 SP1 Cumulative Update 4
The TFS 2012 requires the CU1 at least, but you should go up to at least CU4, since this update solves a ghost record problem that otherwise may cause your TFS database to not release records the way it should when you clean it up, see this post for more information on that issue.   Oct 2011 SQL Server 2008 R2 SP1

#1: MSDN Subscription download site, require login) v


Friday, November 30, 2012 #


During the summer and fall this year, me and my colleague Jakob Ehn has worked together on a book project that has now finally hit the stores!
The title of the book is Team Foundation Server 2012 Starter and is published by Packt Publishing.

Get it from http://www.packtpub.com/team-foundation-server-2012-starter/book or from Amazon http://www.amazon.com/dp/1849688389 

                 image 

The book is part of a concept that Packt have with starter-books, intended for people new to Team Foundation Server 2012 and who want a quick guideline to get it up and working. 
It covers the fundamentals, from installing and configuring it, and how to use it with source control, work items and builds. It is done as a step-by-step guide, but also includes best practices advice in the different areas. It covers the use of both the on-premises and the TFS Services version. It also has a list of links and references in the end to the most
relevant Visual Studio 2012 ALM sites.

Our good friend and fellow ALM MVP Mathias Olausson have done the review of the book, thanks again Mathias!

We hope the book fills the gap between the different online guide sites and the more advanced books that are out.

Book Description

Your quick start guide to TFS 2012, top features, and best practices with hands on examples


Overview

  • Install TFS 2012 from scratch
  • Get up and running with your first project
  • Streamline release cycles for maximum productivity


In Detail

Team Foundation Server 2012 is Microsoft's leading ALM tool, integrating source control, work item and process handling, build automation, and testing.

This practical "Team Foundation Server 2012 Starter Guide" will provide you with clear step-by-step exercises covering all major aspects of the product.
This is essential reading for anyone wishing to set up, organize, and use TFS server.

This hands-on guide looks at the top features in Team Foundation Server 2012, starting with a quick installation guide and then moving into using it for your
software development projects. Manage your team projects with Team Explorer, one of the many new features for 2012.

Covering all the main features in source control to help you work more efficiently, including tools for branching and merging, we will delve into the Agile Planning
Tools for planning your product and sprint backlogs.

Learn to set up build automation, allowing your team to become faster, more streamlined, and ultimately more productive with this
"Team Foundation Server 2012 Starter Guide".


What you will learn from this book

  • Install TFS 2012 on premise
  • Access TFS Services in the cloud
  • Quickly get started with a new project with product backlogs, source control, and build automation
  • Work efficiently with source control using the top features
  • Understand how the tools for branching and merging in TFS 2012 help you isolate work and teams
  • Learn about the existing process templates, such as Visual Studio Scrum 2.0
  • Manage your product and sprint backlogs using the Agile planning tools


Approach

This Starter guide is a short, sharp introduction to Team Foundation Server 2012, covering everything you need to get up and running.


Who this book is written for

If you are a developer, project lead, tester, or IT administrator working with Team Foundation Server 2012 this guide will get you up to speed quickly
and with minimal effort.


Sunday, August 19, 2012 #

If you have projects created under Visual Studio 2010 (SP1), and mixed C++ and C# projects in the solution, and you are using other configurations than Debug/Release x86 you may hit a very strange situation when you run the Static Code Analysis, either alone, or as part of the build.

You may get into a situation which seems like things go in circles.  One error points to a place where it simply points back to the first one.  This is in fact, two kind of errors causing this behavior.

Now, what you see is this:

image

The new Code Analysis window tells you it has issues around the platform toolset,  pointing you to the Error list, which just tells you that Code Analysis has detected errors, and points you back to the Code Analysis Window, or ask you to look up the log, which whereabouts is not known…….

This situation is caused by two different errors working in (dis)harmony.

The first issue is the platform issue.  The Code Analysis window will only show warnings/errors from a C++ project if the platform toolset is set to VS 2012.  If you have created this solution/project in VS 2010, it will be set to VS 2010.  All errors from the VS 2010 C++ code analysis will then be shown in the Error list window, and not in the new Code Analysis window.

If you look in the project properties for a C++ project you find this setting under Configuration Properties/General – Platform Toolset, and the possible values are either Visual Studio 2010 (v100) or Visual Studio 2012 (v110) (or VS2008 which is v90). 

image

If this is set to anything but v110, the list of Code Analysis errors will go to the Error Window.

Now, this is fine, except, it doesn’t get there….

 

Which is caused by another error which is not shown now, it would have been shown in the Code Analysis window, if it hadn't been covered by this error.  This is the CA00053 error, an error in the csproj project file caused by a VS 2010 SP1 error.  It has been fixed in VS 2012, but is still in VS 2010, so any project you move over from VS2010 is suspect to have this issue.  See this blog post for more information on how to handle this error, there is even a tool to fix the project file.   http://geekswithblogs.net/terje/archive/2012/08/18/how-to-fix-the-ca0053-error-in-code-analysis-in.aspx 

So, fix your project files, using the tool at http://visualstudiogallery.msdn.microsoft.com/471da13b-d415-4a44-a4e9-a8222316b902, then you will see the analysis errors/warnings  in the error windows, your build will not be broken, and in the Code Analysis window you will just get the warning above.


Saturday, August 18, 2012 #

Background

You are opening a solution made in Visual Studio 2010 with VS 2012.  When you run Code Analysis you get a series of CA0053 errors, saying it is unable to load the rule sets from the Visual Studio 2010 directory!

In the Error window you get an error message saying “Code Analysis detected errors.”

image

And in the Code Analysis window you will get the “CA0053 Error running code analysis” with its “Unable to load rule assembly”.

clip_image001

This means the project is bound to Visual Studio 2010, where it should have been Visual Studio version independent. The absolute path to the Visual Studio 10 binaries is what causes the problem.

What has happened was that this certain VS2010 specific information was “inadvertently” introduced in SP1, and it has not been fixed in any later update.

It does NOT happen if you run in Debug|x86 or Release|x86, but any other configuration you have added will give you this error.

Fixing the error

The error must be fixed by changing the project files.  If you have only a few projects in your solution, you can fix them manually.  If you have a lot of projects in your solution, I have uploaded a small tool to help in the process.  After the fix, the projects will work both in VS 2010 and in VS 2012 with no side effects.

The error seems to be introduced only when a new configuration is created.  Subsequent changes to an existing configuration doesn’t seem to reintroduce the error.  So the fixes below will stay fixed.  Be aware that if anyone adds a new configuration using VS 2010, the error will be introduced again for that new configuration.  Then run the fix again.

Update:  It has been reported that also other changes you do (not identified which yet) may revert the change, see for example this blogpost.

The bug is fixed in VS2012 however, so if you use VS 2012 to add new configuration, all will be well, and those configurations will be backward compatible with VS 2010.

Manual fix

Open the project file in an editor.

You do this by right click the project in the solution editor and either choose “Edit Project File” or “Unload Project” followed by “Edit” afterwards.

Now find all occurrences of the string “Microsoft Visual Studio 10.0

They should all be in two fields, named <CodeAnalysisRuleDirectories> and <CodeAnalysisRuleSetDirectories>. 

Alternative 1:  The very safe way

Replace the content to be as follows:

<CodeAnalysisRuleDirectories>$(DevEnvDir)\..\..\Team Tools\Static Analysis Tools\FxCop\Rules</CodeAnalysisRuleDirectories>

<CodeAnalysisRuleSetDirectories>$(DevEnvDir)\..\..\Team Tools\Static Analysis Tools\Rule Sets</CodeAnalysisRuleSetDirectories>

Alternative 2: Which seems to work

Simply delete the fields completely. 

It seems to work in the conditions I have tested, but if you should get into a condition where it doesn’t work, go back to alternative 1 for that case.  And please, send me a note, I would like to know.

(I noted this blogpost by Alun Jones , where he deleted only the content of the field, that should also work)

PS:  Why not use Find/Replace:  You can try, but the full content of the fields will differ dependent upon what operating system you run, x86 or x64, and if both have been used, for example because your team’s developers have both, all of these paths will be written into these fields.  That is at least 4 permutations.  A tool is better!

 

Automatic fix using the FixCA0053 tool

The tool can be downloaded from Visual Studio Gallery here.   Place it somewhere easy to find.

Open a command line window, and go down to the top directory of your project. 

Then simply call the program from there.

The program will locate all the csproj files from that location and in all subdirectories of that location, and change the fields as in Alternative 1 above.

The tool will output how many files it fixed, and how many was skipped because the error was not there. 

image

TIP

If it tells you it could not write to some files, you have probably forgot to check them out.  To check out ONLY the csproj files (In Solution Explorer it will check out all files, you may not want that), use the Source Control Explorer, go to the location where you want to start, right click and choose Find in Source control/Wildcard.  Enter the Wildcard “*.csproj” and check Recursive.  In the next window coming up, you can select all the files, right click and choose “Check out”.

Source code

The source code will be uploaded to Codeplex at http://inmetatools.codeplex.com/ (Under construction)


Sunday, June 24, 2012 #

Find the video HERE.

Updated June 28th 2012:  Marcel has blogged about this too.

 

Adam Cogan did a great Web TV interview with Marcel de Vries and myself on the topics of architecture and code quality.  It was real fun participating in this session.  Although we know each other from the MVP ALM community,  Marcel, Adam and I haven’t worked together before. It was very interesting to see how we agreed on so many terms, and how alike we where thinking.  The basics of ensuring you have a good architecture and how you could document it is one thing.  Also, the same agreement on the importance of having a high quality code base, and how we used the Visual Studio 2012 tools, and some others (NDepend for example)  to measure and ensure that the code quality was where it should be.  As the tools, methods and thinking popped up during the interview it was a lot of “Hey !  I do that too!”. 

The tools are not only for “after the fact” work, but we use them during the coding.  That way the tools becomes an integrated part of our coding work, and helps us to find issues we may have overlooked. 

The video has a bunch of call outs, pinpointing important things to remember. These are also listed on the corresponding web page. I haven’t seen that touch before, but really liked this way of doing it – it makes it much easier to spot the highlights. 

Titus Maclaren and Raj Dhatt from SSW have done a terrific job producing this video.  And thanks to Lei Xu for doing the camera and recording job.  Thanks guys !

Also, if you are at TechEd Amsterdam 2012, go and listen to Adam Cogan in his session on “A modern architecture review: Using the new code review tools” Friday 29th, 10.15-11.30 and Marcel de Vries session on “Intellitrace, what is it and how can I use it to my benefit” Wednesday 27th, 5-6.15

The highlights points out some important practices.  I’ll elaborate on a few of them here:

  • Add instructions on how to compile the solution.  You do this by adding a text file with instructions to the solution, and keep it under source control.  These instructions should contain what is needed on top of a standard install of Visual Studio.  I do a lot of code reviews, and more often that not, I am not even able to compile the program, because they have used some tool or library that needs to be installed.  The same applies to any new developer who enters into the team, so do this to increase your productivity when the team changes, or a team member switches computer.
    • Don’t forget to document what you have to configure on the computer, the IIS being a common one.
    • The more automatic you can do this, the better.  Use NuGet to get down libraries.
    • When the text document gets more than say, half a page, with a bunch of different things to do, convert it into a powershell script instead. 
  • The metrics warning levels.  These are very conservatively set by Microsoft.  You rarely see anything but green, and besides, you should have color scales for each of the metrics.  I have a blog post describing a more appropriate set of levels, based on both research work and industry “best practices”.  The essential limits are:
    • Cyclomatic complexity and coupling:  Higher numbers are worse
      • On method levels:
        • Green :  From 0 to 10
        • Yellow:  From 10 to 20  (some say 15).   Acceptable, but have a look to see if there is something unneeded here.
        • Red: From 20 to 40:   Action required, get these down.
        • Bleeding Red: Above 40   This is the real red alert.  Immediate action!  (My invention, as people have asked what do I do when I have cyclomatic complexity of 150.  The only answer I could think of was: RUN! )
    • Maintainability index:  Lower numbers are worse, scale from 0 to 100.
      • On method levels:
        • Green:  60 to 100
        • Yellow:  40 – 60.    You will always have methods here too, accept the higher ones, take a look at those who are down to the lower limit.  Check up against the other metrics.)
        • Red:  20 – 40:  Action required, fix these.
        • Bleeding red:  Below 20.  Immediate action required.
    • When doing metrics analysis, you should leave the generated code out.  You do this by adding attributes, unfortunately Microsoft has “forgotten” to add these to all their stuff, so you might have to add them to some of the code.  It most cases it can be done so that it is not overwritten by a new round of code generation.  Take a look a my blog post here for details on how to do that.
    • Class level metrics might also be useful, at least for coupling and maintenance.  But it is much more difficult to set any fixed limits on those.  Any metric aggregations on higher level tend to be pretty useless, as the number of methods vary pretty much, and there are little science on what number of methods can be regarded as good or bad.  NDepend have a recommendation, but they say it may vary too.  And in these days of data binding, the number might be pretty high, as properties counts as methods.  However, if you take the worst case situations, classes with more than 20 methods are suspicious, and coupling and cyclomatic complexity go red above 20, so any classes with more than 20x20 = 400 for these measures should be checked over.
  • In the video we mention the SOLID principles, coined by “Uncle Bob” (Richard Martin). One of them, the Dependency Inversion principle we discuss in the video.  It is important to note that this principle is NOT on whether you should use a Dependency Inversion Container or not, it is about how you design the interfaces and interactions between your classes.  The Dependency Inversion Container is just one technique which is based on this principle, but which main purpose is to isolate things you would like to change at runtime, for example if you implement a plug in architecture.  Overuse of a Dependency Inversion Container is however, NOT a good thing.  It should be used for a purpose and not as a general DI solution.  The general DI solution and thinking however is useful far beyond the DIC.   You should always “program to an abstraction”, and not to the concreteness. 
  • We also talk a bit about the GRASP patterns, a term coined by Craig Larman in his book Applying UML and design patterns. GRASP patterns stand for General Responsibility Assignment Software Patterns and describe fundamental principles of object design and responsibility assignment.  What I find great with these patterns is that they is another way to focus on the responsibility of a class.  One of the things I most often found that is broken in software designs, is that the class lack responsibility, and as a result there are a lot of classes mucking around in the internals of the other classes. 
  • We also discuss the term “Code Smells”.  This term was invented by Kent Beck and Martin Fowler when they worked with Fowler’s “Refactoring” book. A code smell is a set of “bad” coding practices, which are the drivers behind a corresponding set of refactorings.  Here is a good list of the smells, and their corresponding refactor patterns. See also this.

Tuesday, June 5, 2012 #

Updated: June 7th 2012:  Cause for the issues found! Unsupported scenario having TFS 11 Beta side-by-side.  Uninstall TFS 11 Beta before or even after install of VS 2012 RC.

The Visual Studio RC has shown some install issues in some cases, particularly for those who upgrades from VS 11 Beta.  These issues are caused by also having TFS 11 Beta server installed on the same machine.  This is not a supported scenario.  What is good is that if you forget to uninstall TFS Beta 11 first, and get these issues, all that is required is to uninstall TFS 11 Beta, and VS 2012 RC will start working correctly!

I have listed the symptoms known now below, and will update if there are more issues.  Note that a repair will not fix the issue, and a Windows restore and subsequent reinstall may not fix it either.  The fixes below however, cures these issues, but you don’t have to do these now, just uninstall TFS 11 beta!

 

This forum post is about the same issues.

1. The Team Explorer Build node fails

When you try to access the Team Explorer Build node, you get a System.TypeLoadException error like this:

System.TypeLoadException: Could not load type 'Microsoft.TeamFoundation.Common.TfsBackgroundWorkerManager'

clip_image001

To solve this do as follows:

1. Open a command prompt as administrator

2. Go to your program files directory for VS 2012 and down to  the extension folder like:   C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer

3. Run “gacutil –if Microsoft.TeamFoundation.Build.Controls.dll

 

clip_image002

 

2. Accessing the Process node on Edit Build Definition fails

When you Edit a build definition and open the Process tab, it starts to load the custom assemblies (if you have any), then it stops before displaying the process parameters, with the messagebox : Team Foundation Error: Method not found: ‘System.String Microsoft.TeamFoundation.Build.Workflow.ProcessParameterError.get_ParameterValue()’

image

To solve this do as follows:

1. Go to C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies

2. Run gacutil /if Microsoft.TeamFoundation.Build.Workflow.dll

3. The SQL Editor gives loading error

When you start up VS 2012 RC you get a loading error message.  The same happens if you try to go from the menu to  SQL/Transact-SQL Editor/New Query.

The ‘SqlStudio Editor Package’ package did not load correctly, or  The ‘SqlStudio Profile Package’ package did not load correctly, or The ‘Microsoft.VisualStudio.Data.Tools.SqlLanguageServices.Package’ did not load correctly.  You might even get all of these.

 

clip_image001

 

To solve this do as follows:

1. Open Control Panel/Programs and Features

2. Locate the “Microsoft SQL Server 2012 Data-Tier App Framework

    (Note , you might find up to 4 such instances)

clip_image002[5]

The ones with version numbers ending in 55 is from the SQL 2012 RC, the ones ending in 60 is from the SQL 2012 RTM.  There are two of each, one for x32 and one for x64.  Which is which no one knows.

3. Right click each of them, and select Repair.

(It would be nice if someone with this issue tries only the latest RTM ones, and see if that clears the error, and comment back to this post. I am out of non-functioning VS’s )

 

4.  Errors referring to some extension

You get errors referring to some extension that can’t be loaded, or can’t be found.  Check the activity log (see below), and verify there.  If you see yellow collision warnings there, the fix here should solve those too.

To solve these:   

1. Open a Visual Studio 2012 command prompt

2.  Run:   devenv /resetsettings

 

 

How to check for errors using the log

Do as follows to get to the activity log for Visual studio 2012 RC

1. Open a Visual Studio 2012 command prompt

2. Run:   devenv /log

This starts up Visual Studio. 

3. Go to %appdata%/Microsoft\VisualStudio\11.0

image

4. Double click the file named ActivityLog.xml. 

It will start up in your browser, and be formatted using the xslt in the same directory.

5.  Look for items marked in red. 

Example for Issue 1 :

image


Sunday, May 6, 2012 #

Download from VS Gallery 

In my work I meet many developers, tester and project managers, all using Visual Studio.  When I ask them if they have updated it to the latest version, there are many who simply don’t know.  Should you always update ? YES, you should. The Visual Studio development teams are continuously making improvements to the product.  The question also often comes when we notice that something doesn’t quite work the way it should, and we then realize it is caused by not having the latest update.  The next issue then comes – how do we find out IF the latest version is installed.  That should be trivial, but it isn't.

If you look at the Help/About in Visual Studio, it tells you if you have SP1 or just the RTM version installed. So far so good.

SNAGHTML39499e

But to find out if you have the latest update, you need to scroll down (green arrows), and then, what you find is a series of hotfix numbers.

image 

Only SOME of these indicates the correct cumulative updates that have been, five in all for the SP1. And, do you know what IS the latest version – I have a list published here, but still – it is hard work! 

So, enter the Version and Update Info Tool.  Install it from here:  http://visualstudiogallery.msdn.microsoft.com/bce6cbf1-fb55-4a7d-b39b-8589634d846f 

Go to the Visual Studio Help menu, next to the bottom is “Version Info”, select it and if everything is as it should be, this is what it should show:

SNAGHTML5618a0

However, if you are lagging behind in your updates, this might be what you will see then:

clip_image002

Or, if you have the SP1 but have missed the later updates:

clip_image002[5]

The tool gives you links to the download sites, and also to information pages for the updates.  If you want information on what your current updates is, you have the name there, and if you go here, at the bottom of that post, the different updates are listed with links to information pages for them.

 

The principles for updating Visual Studio is to first get it up to SP1.  Then you install the latest cumulative update, which is the GRD March 2012.  I call this for the CU3, because it is a cumulative update.  It is named very strangely at the download site Visual Studio 2010 SP1 Team Foundation Server 11 Compatibility GDR , but it is the correct one.

If any new updates for VS 2010 arrives, the Version Info Tool will be updated accordingly. 

Be aware that these updates apply to the Visual Studio Client Tools, and that includes the Test Manager.

And if I get enough available time, I will add it to the top level menu or the status bar IF you are outdated.  That way you will not need to even check it, it will do that for you.  After that, automatic download and update warning would be cool – like it will be in Visual Studio 11. 


Thursday, March 22, 2012 #

This post is continued HERE.

Looking for the VS 2010 extensions ? Go to extensions for VS 2010. Looking for links to the test adapters, go to this blog post.

UPDATE Apr 12th 2013: Updates: Code Contracts, Code Contract Editor Extensions, T4 Toolbox

UPDATE Apr 4th 2013: Updates: Visual Studio 2012 Update 2 ,TFS 2012 with Update 2, and Productivity Power Tools 2012

UPDATE Apr 2th 2013: Visual Studio 2012 Update 2 CTP 4, added T4 Toolbox, Code Contract Editor Extensions, updated Visual Studio Tools for Git , TypeScript, ReSharper, NuGet Manager, Wix Toolset (Version 3.7), Productivity Power Tools, Code Contracts, Slow Cheetah, Web Essentials

UPDATE Feb 5th 2013: Hotfix for TFS 2012 Update 1, update of Slow Cheetah

UPDATE Jan 31th 2013: Visual Studio 2012 Update 2 CTP 2, VS 2012 extension for Gitsupport, small update of Community Build Manager , updated NDepend and ReSharper

UPDATE Dec 17th 2012: Added Productivity Power Tools, remove Power Commands. Update of NDepend, NuGet.

UPDATE Dec 10th 2012: Visual Studio 2012 Update 1, TFS 2012 with Update 1, and LinqPad added, updates on ReSharper, TypeScript, TFS Power Tools, Build Manager, Code Contracts,Visualization and Modeling SDK, Slow Cheetah, Web Essentials, Just Decompile and tangible T4 editor

UPDATE Oct 31th 2012: Typescript added, Visual Studio Update 1 CTP4 added, NuGet updated

UPDATE Sept 16th 2012: New TFS Power Tools, NuGet updated

UPDATE Sept 12th 2012: New version of Code Contracts

UPDATE Sept 10th 2012: Added Slow Cheetah, WiX 3.6 released

UPDATE Aug 31th 2012: Updated for RTM

UPDATE June 17th 2012: New versions of Feedback Tool and SDK for the RC.

UPDATE May 30th 2012: Visual Studio 2012 and TFS 2012 RC released. Updated names to 2012.

UPDATE April 8th 2012: April Update of Visual Studio 11 Beta. Added Code Contracts - released for Dev 11. New version of NuGet Manager

This post is a list of the extensions I recommend for use with Visual Studio 2012. It’s coming up all the time – what to install, where are the download sites, last version, etc etc, and thus I thought it better to post it here and keep it updated. The basics are Visual Studio 2012 connected to a Team Foundation Server 2012.

Many live in a side-by-side environment with Visual Studio 2010. The side-by-side is supported by VS 2012. However, if you installed a component supporting VS2012 before you installed VS2012, then you need to reinstall it. The VSIX installer will understand that it is to apply those only for VS2012, and will not touch – nor remove – the same for VS2010. A good example here is the Power Commands.

The list is more or less in priority order.

The focus is to get a setup which can be used for a complete coding experience for the whole ALM process.

The list of course reflects what I use for my work , so it is by no means complete, and for some of the tools there are equally useful alternatives. Many components have not yet arrived with VS2012 support. I will add them as they arrive.

The components directly associated with Visual Studio from Microsoft should be common, see the Microsoft column.

If you want to use the same set of extensions on multiple computers, you might like to share them easily. Lars Wilhelmsen has a great blog post about how to use Dropbox to share extensions and common settings.

Components ready for VS 2012, both upgrades and new ones

Product NotesLatest VersionLicenseApplicable toMicrosoft
Visual Studio Tools for Git1 See Brian Harry’s blogpost 0.8.0.0Pre-releaseVisual StudioYes
TypeScriptSee info here, and B.Harry’s blogpost. Codeplex here0.8.3.1FreeCodingYes
ReSharper3 7.1.25.234 (.2000.1478)LicensedCoding & QualityNo
NuGet Manager1 3Initial install included with VS 2012. Updates through extension gallery2.2.40116.9051FreeVisual StudioYes
TFS Power Tools1See Brian Harry’s blog post for more info
(Side-by-side with TFS 2010 should work, but remove the Shell Extension from the TFS 2010 power tool first.), and this post for info on Update 1
(Link to RTM Power tools here if you need this)
Nov 2012(11.0.51126.0) FreeTFS integrationYes
NDepend3 Info on updates here. Trial available.

4.1.0.6871

LicensedQualityNo
Build Manager1 Community Build Manager. Info here from Jakob1.4.0.9FreeTFS IntegrationNo
Visual Studio 2012 SDKRequired for using WixPublished 2.Aug.2012FreeVisual StudioYes
Wix Toolset3.7FreeCoding/InstallersNo
Visual Studio 11 Feedback tool1Use this to really ease the process of sending bugs back to Microsoft. 1.2.3FreeVisual StudioYes
Productivity Power Tools1Re-added with new features, now also includes Power Commands, which can be uninstalled. 11.0.60403.0FreeVisual StudioYes
Power Commands1 3 Just reinstall, even if you already have it for VS2010. The reinstall will then apply it to VS 2012
Install Productivity Power Tools which includes Power Commands
1.0.2.3FreeCodingYes
Code Contracts1 3 Now on gallery too. Info here and follow the forum here
1.4.60409.11FreeCodingYes
Code Contract Editor Extensions1 1.5.60409.11FreeCodingYes
Visualization and Modeling SDKRequires VS 2012 SDK
RTM (Sept. 29th 2012)Free now, otherwise Part of MSDN SubscriptionModeling, DSL, UML extensionsYes
Slow Cheetah1 Tool for transforming XML files, like config files. 2.5.5FreeCodingNo
Web Essentials1 2.6FreeCodingYes
ILSpyDecompiler. Can also export assembly as C# project2.1.0.1603FreeCoding/InvestigationNo
DotPeek 1.0.0.8644FreeCoding/InvestigationNo
Just Decompile 2012.3.1016FreeCoding/InvestigationNo
T4 Toolbox111.5.0FreeCoding (T4 templates)No (Author now MSFT)
tangible T4 editor1 2.1.1Lite version Free (Good enough)Coding (T4 templates)No
LinqPadInfo here4.43.06Free and licensed versionsCodingNo

#1 Get via Visual Studio’s Tools | Extension Manager (or The Code Gallery). (From Adam : All these are auto updated by the Extension Manager in Visual Studio)

#2 Works with ultimate only

#3 Also works with VS 2010

Components we wait for, not yet in a VS 2012 version

Product NotesLatest VersionLicenseApplicable toMicrosoft
Inmeta Build Explorer FreeTFS integrationNo

Components which are now integrated into VS 2012

ProductNotes
Fakes Was Moles in 2010. Fakes is improved and made into a product.
NuGet ManagerIncluded in the install, but still an extension package. Info here. So it is updated through the extension manager. Initial version is 1.6.30117.9648

Product installation, upgrades and patches for VS/TFS 2012

ProductNotesVersion numberDateApplicable to
Visual Studio 2012 Update 2
and
TFS 2012 with Update 2
See Brian Harry’s blogpost and MSDN Blogpost
Also see links to other updates in the VS 2012 Update 2 page
11.0.60315.01
2012.2
Apr 4th 2013VS and TFS
VS2012 Update 2 CTP 4See KB2797912 and 11.0.60223.1Mar 3rd 2013VS and TFS
VS 2012 Update 2 CTP 2See Brian Harry’s blogpost and KB2797912 11.0.60115.01Jan 30th 2013VS and TFS
Hotfix 1 for TFS Update 1See Brian Harry’s blogpost, and KB280362511.0.60123.0Feb 1st 2013TFS
Visual Studio 2012 Update 1You should find it as a product update in the Extension Manager.
Info from Brian H here, and other info here ( and here written for CTP4 but valid). Also see all downloads from here.
11.0.51106.1
2012.1
Nov 26th 2012Visual Studio
TFS 2012 with Update 1Complete install or upgrade from RTM. 11.0.51106.1Nov 26th 2012TFS
Visual Studio 2012 Update 1 CTP 411.0.51020.3Oct 29th 2012Visual Studio and TFS
Visual Studio 2012 & TFS 2012

11.0.50727.1

Aug 15th 2012Visual Studio and TFS
July 2012 Update

11.0.50626.1

July 2012Visual Studio and TFS
Visual Studio 2012 & TFS 2012 RCSee Brian Harry’s blogpost, more links inside there11.0.50522.1May 31th 2012Visual Studio and TFS
April 2012 Update1See KB2677574 and VS Blogpost for more information.
Get the update using Tools/Extension Manager/Product Update.
11.0.50323.1April 2012Visual Studio
Visual Studio 11 & TFS 11 BetaThis is the beta release, and you are free to download and try it out. 11.0.50214.1March 2012Visual Studio and TFS
SQL Server 2008 R2 SP1 Cumulative Update 4
The TFS 2012 requires the CU1 at least, but you should go up to at least CU4, since this update solves a ghost record problem that otherwise may cause your TFS database to not release records the way it should when you clean it up, see this post for more information on that issue. Oct 2011SQL Server 2008 R2 SP1

#1: MSDN Subscription download site, require login) v

v

Saturday, March 10, 2012 #

Deployment of custom checkin policies can be done using either an MSI or VSIX.  There are many reasons to prefer using the VSIX format. It is more lightweight, and thus more suitable for small components for VS, as it will not “pollute” the installed programs store. Further, since the Visual Studio setup projects have been cut from Visual Studio 11, the VSIX is a better choice, being supported both in VS 2010 and VS 11.  VSIX is also very easy to create, once you know how, and it is very fast running too.

Jim Lamb had an excellent blog post about how to implement, package and deploy custom checkin policies using VSIX. Unfortunately that post lacks some details.  Aaron Marten found some of the issues here.  I have gone through both of these and in this blog post I will show the details of how you can package this in a VSIX.

Jim Lambs post fully explains how to implement a custom policy, so I will not go through that again.

In order to package it in a VSIX, follow the steps below:

  1. Install the Visual Studio SDK.  The SDK has the project templates for the VSIX
    1. Visual Studio 2010 SDK:  http://www.microsoft.com/download/en/details.aspx?id=2680 
    2. Visual Studio 11 SDK:  http://www.microsoft.com/download/en/details.aspx?id=28990 
    3. When you install the SDK, you get a new set of Project items under the folder “Extensibility” (1 in figure below)
  2. Add a VSIX project to the solution with your custom checkin policy
    1. SNAGHTML9e57448
    2.   Choose the VSIX Project type (2).
  3. In the VSIX project add a reference to your custom checkin policy project
    1. image
  4. You then should add some items to the project, but only one of these is mandatory:
    1. image
    2. Item #1 is an icon bitmap.  Nice to have, but optional
    3. Item #2 is a license text document. Nice to have, but optional
    4. Item #3 is a package definition file. This is mandatory, and contains instructions for setting up a registry key. This registry key is needed by Visual Studio in order to find and load the checkin policies.
      1. You just add a text file, and name it policies.pkgdef.  The name can be anything, but the extension should be “pkgdef”.
  5. Edit the policies.pkgdef to look like this:
    1. [$RootKey$\TeamFoundation\SourceControl\Checkin Policies]
      "Inmeta.TFS.CheckinPolicies"="$PackageFolder$\Inmeta.TFS.CheckinPolicies.dll"     (Copy paste from this)
      image
      Part 1:  This is a name you choose to give your policy package, and which will be the name of the key in the registry 
      Part 2:  This is the assembly name as defined in the project properties, Application/Assembly name field. image
  6. At last you have to set up the vsixmanifest file, the one named source.extension.vsixmanifest.  In VS 2010 there is an editor for that file, but in VS 11 Beta the editor is not there, and you must edit the file yourself. It can be an easy way out to make it first in VS 2010, and then open it up afterwards in VS 11.  The whole VSIX project will then be upgraded to the VSIX format for VS 11.
    1. VS2010:  Using the editor to set up the manifest

image

1) When you update your checkin policy, increment the version number too.  This will make the VSIX updateable.

2) Select the Visual Studio editions the VSIX shall apply for.  You only need to set the lowest SKU, all above are automatically allowed.

SNAGHTMLa280755

3) You have to add the policies.pkgdef file as Content to the manifest.

SNAGHTMLa265fe0

4) The result of the Add Content operation in 3).

5) These fields are optional. The License Terms is the name of a text or rtf file. Add one to the project and name it here. The Icons and Preview Image’s can be added, any bitmap file will do. The icon must have the right size of course. The URL field and Getting started guide can be filled in as one likes.

Now, for VS 11, the manifest must be edited as an XML file:

<?xml version="1.0" encoding="utf-8"?>
<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
  <Identifier Id="Inmeta.CheckinPolicies11.VSIX..69ec79aa-3c86-492e-b440-decf901288e4">
    <Name>Inmeta.CheckinPolicies11.VSIX</Name>
    <Author>Inmeta Consulting AS</Author>
    <Version>1.437</Version>
    <Description xml:space="preserve">Inmeta Checkin Policies for Visual Studio 11</Description>
    <Locale>1033</Locale>
    <MoreInfoUrl>http://intranet.osiris.no/knowledge/Wiki%20Pages/OCPChangeLog.aspx</MoreInfoUrl>
    <License>License.txt</License>
    <Icon>ICP.bmp</Icon>
    <SupportedProducts>
      <VisualStudio Version="11.0">
        <Edition>Pro</Edition>
      </VisualStudio>
    </SupportedProducts>
    <SupportedFrameworkRuntimeEdition MinVersion="4.0" MaxVersion="4.0" />
  </Identifier>
  <References />
  <Content>
    <VsPackage>policies.pkgdef</VsPackage>
  </Content>
</Vsix>

Note that you must change the Visual Studio version attribute to read “11.0”.  Otherwise the rest of the fields should be easily understandable from the editor description above.

 

Finishing it: 

This is all you need to do. Compile it, and install the VSIX by double-clicking it. Note that it first takes effect when you restart Visual Studio.

 

Notes:

When you port your checkin policies from VS 2010 to VS 11, be aware that you change the references from pointing to the VS 2010 assemblies to point to the new VS 11 assemblies.

In our case we had these assemblies:

image

You may have more or less than these, dependent upon what kind of custom checkin policies you have made.

Also note that one checkin project can contain many checkin policies.  Our package contains these:

image

 

There are guidelines on the net on how to use assembly binding redirection to make VS 11 use VS 2010 assemblies.  This is also a way to go, but I prefer to convert them to VS 11 proper.


Sunday, November 27, 2011 #

Memory for managed code is handled by the garbage collector, but if you use any kind of unmanaged code, like native resources of any kind, open files, streams and window handles, your application may leak memory if these are not properly handled.  To handle such resources the classes that own these in your application should implement the IDisposable interface, and preferably implement it according to the pattern described for that interface.

When you suspect a memory leak, the immediate impulse would be to start up a memory profiler and start digging into that.   However, before you follow that impulse, do a Static Code Analysis run with a ruleset tuned to finding possible memory leaks in your code.  If you get any warnings from this, fix them before you go on with the profiling.

How to use a ruleset

In Visual Studio 2010 (Premium and Ultimate editions) you can define your own rulesets containing a list of Static Code Analysis checks.   I have defined the memory checks as shown in the lists below as ruleset files, which can be downloadedsee bottom of this post.  When you get them, you can easily attach them to every project in your solution using the Solution Properties dialog. Right click the solution, and choose Properties at the bottom, or use the Analyze menu and choose “Configure Code Analysis for Solution”:

image

In this dialog you can now choose the Memorycheck ruleset for every project you want to investigate.  Pressing Apply or Ok opens every project file and changes the projects code analysis ruleset to the one we have specified here.

How to define your own ruleset  (skip this if you just download my predefined rulesets)

If you want to define the ruleset yourself, open the properties on any project, choose Code Analysis tab near the bottom, choose any ruleset in the drop box and press Open

image

Clear out all the rules by selecting “Source Rule Sets” in the Group By box, and unselect the box

image

Change the Group By box to ID, and select the checks you want to include from the lists below.

Note that you can change the action for each check to either warning, error or none, none being the same as unchecking the check.

image

 

Now go to the properties window and set a new name and description for your ruleset.

Then save (File/Save as) the ruleset using the new name as its name, and use it for your projects as detailed above.

It can also be wise to add the ruleset to your solution as a solution item. That way it’s there if you want to enable Code Analysis in some of your TFS builds.

 

Running the code analysis

In Visual Studio 2010 you can either do your code analysis project by project using the context menu in the solution explorer and choose “Run Code Analysis”, you can define a new solution configuration, call it for example Debug (Code Analysis), in for each project here enable the Enable Code Analysis on Build

image

 

In Visual Studio Dev-11 it is all much simpler, just go to the Solution root in the Solution explorer, right click and choose “Run code analysis on solution”.

 

 

The ruleset checks

The following list is the essential and critical memory checks. 

CheckID Message Can be ignored ? Link to description with fix suggestions
CA1001 Types that own disposable fields should be disposable No  http://msdn.microsoft.com/en-us/library/ms182172.aspx
CA1049 Types that own native resources should be disposable Only if the pointers assumed to point to unmanaged resources point to something else  http://msdn.microsoft.com/en-us/library/ms182173.aspx
CA1063 Implement IDisposable correctly No  http://msdn.microsoft.com/en-us/library/ms244737.aspx
CA2000 Dispose objects before losing scope No  http://msdn.microsoft.com/en-us/library/ms182289.aspx
CA2115 1 Call GC.KeepAlive when using native resources See description  http://msdn.microsoft.com/en-us/library/ms182300.aspx
CA2213 Disposable fields should be disposed If you are not responsible for release, of if Dispose occurs at deeper level  http://msdn.microsoft.com/en-us/library/ms182328.aspx
CA2215 Dispose methods should call base class dispose Only if call to base happens at deeper calling level  http://msdn.microsoft.com/en-us/library/ms182330.aspx
CA2216 Disposable types should declare a finalizer Only if type does not implement IDisposable for the purpose of releasing unmanaged resources  http://msdn.microsoft.com/en-us/library/ms182329.aspx
CA2220 Finalizers should call base class finalizers No  http://msdn.microsoft.com/en-us/library/ms182341.aspx

Notes:

1) Does not result in memory leak, but may cause the application to crash

 

The list below is a set of optional checks that may be enabled for your ruleset, because the issues these points too often happen as a result of attempting to fix up the warnings from the first set.

 

ID Message Type of fault Can be ignored ? Link to description with fix suggestions
CA1060 Move P/invokes to NativeMethods class Security No http://msdn.microsoft.com/en-us/library/ms182161.aspx
CA1816 Call GC.SuppressFinalize correctly Performance Sometimes, see description http://msdn.microsoft.com/en-us/library/ms182269.aspx
CA1821 Remove empty finalizers Performance No http://msdn.microsoft.com/en-us/library/bb264476.aspx
CA2004 Remove calls to GC.KeepAlive Performance and maintainability Only if not technically correct to convert to SafeHandle http://msdn.microsoft.com/en-us/library/ms182293.aspx
CA2006 Use SafeHandle to encapsulate native resources Security No http://msdn.microsoft.com/en-us/library/ms182294.aspx
CA2202 Do not dispose of objects multiple times Exception (System.ObjectDisposedException) No http://msdn.microsoft.com/en-us/library/ms182334.aspx
CA2205 Use managed equivalents of Win32 API Maintainability and complexity Only if the replace doesn’t provide needed functionality http://msdn.microsoft.com/en-us/library/ms182365.aspx
CA2221 Finalizers should be protected Incorrect implementation, only possible in MSIL coding No http://msdn.microsoft.com/en-us/library/ms182340.aspx

 

Downloadable ruleset definitions

I have defined three rulesets, one called Inmeta.Memorycheck with the rules in the first list above, and Inmeta.Memorycheck.Optionals containing the rules in the second list, and the last one called Inmeta.Memorycheck.All containing the sum of the two first ones. 

All three rulesets can be found in the  zip archive  “Inmeta.Memorycheck” downloadable from here.

 

Links to some other resources relevant to Static Code Analysis

MSDN Magazine Article by Mickey Gousset on Static Code Analysis in VS2010

MSDN :  Analyzing Managed Code Quality by Using Code Analysis, root of the documentation for this

Preventing generated code from being analyzed using attributes

Online training course on Using Code Analysis with VS2010

Blogpost by Tatham Oddie on custom code analysis rules

How to write custom rules, from Microsoft Code Analysis Team Blog

Microsoft Code Analysis Team Blog