How to fix the CA0053 error in Code Analysis in Visual Studio 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.”
Visual Studio 2010: Version and update information tool
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.
Visual Studio & TFS 2012 – List of extensions and tools (Part 2)
This post is continued HERE.
Go to Part 1 – List of Product Updates for information on Visual Studio and TFS 2012 updates
Looking for the VS 2010 extensions? Go to Visual Studio 2010 - List of Product Updates (Part 1) + Extensions (Part 2).
Looking for links to the test adapters, go to this blog post.
UPDATE Aug 18th 2013: Updates: Visual Studio Tools for Git, TypeScript, ReSharper, TFS Power Tools, Code Contracts, Build Manager, Web Essentials, tangible T4 editor, Just Decompile, DotPeek ADDED: Inmeta AssociateRecentWorkItems, Unit Test Generator
Using the Static Code Analysis feature of Visual Studio (Premium/Ultimate) to find memory leakage problems
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.
Guide to reduce TFS database growth using the Test Attachment Cleaner
UPDATED March 24th 2016: Test Data Retention is now added to TFS 2015 Update 1, see this post for more information.
UPDATED Apr 15th 2013: Corrected to VS2012 Update 2
UPDATED Mar 23rd 2012: Added information about VS 11
UPDATED Mar 21st 2012: Added info and link to VS/TFS 11 tool for getting the Test Attachment Cleaner, now included with the TFS Power Tools
New version of the Inmeta Build Folder Extension
The 1.0.1 version of the Build Folder Extension is now out and can be downloaded from the Visual Studio Code Gallery at http://visualstudiogallery.msdn.microsoft.com/35daa606-4917-43c4-98ab-38632d9dbd45
Source code, discussions and issue tracking can be found at the codeplex site at http://tfsbuildfolders.codeplex.com/
Context menu
The context menu has been extended with the following commands, shown below:
Queue New Build… : This pops up the traditional queue build dialog
Visual Studio–Build Folders extension for Team Explorer
We have just released a free extension for Visual Studio which adds a Builds Explorer with folders to the Team Explorer.
The extension can be downloaded from Visual Studio Gallery or just search for Inmeta in Tools/Extension Manager.
The documentation and issue tracking can be found at the codeplex site for the project http://tfsbuildfolders.codeplex.com/ and source code is available there.
Microsoft Test Manager error in displaying test steps caused by malware
Sometimes the tool is blamed for errors which are not the fault of the tool – this is one such story. It was however, not so easy to get to the bottom of it, so I hope sharing this story can help some others.
One of our test developers started to get this message inside the test steps part of a test case in the MTM.
Visual Studio & TFS 2010 – List of extensions and upgrades
This post is about VS 2010, go here for the VS/TFS 11 extensions.
UPDATED Apr 9th 2012: VersionInfo, NuGet, Code Contracts
UPDATED Oct 7th 2012: New Visual Studio GDR
UPDATED Aug 31th 2012: New versions updated of ReSharper, NDepend, Web Essentials, Community Build Manager, Code Contracts (March 2012), NuGet, ILSpy, DotPeek, Just Decompile, tangible T4 editor, LinqPad. Added the VersionInfo tool, so you know you have the latest update of VS 2010
Making Static Code Analysis and Code Contracts work together, or the CA1062 problem
UPDATED: Feb 16th 2012: Workaround #1 and #2 only works when run-time checking is not enabled. Added workaround #2B which seems to work. Thanks to David S, Michael S and ZbynekZ for pointing this out, and sorry for not responding faster to this. Also added comments and overviews over what happens for different settings.
There have been several reports on problems with the Static Code Analysis (SCA) not adhering to the statements of the Code Contract tools. See these links: connect, forum1, forum2.
MSDN Live 2010 – Delivered : 24 sessions (4 x 6) on Visual Studio and Team Foundation Server 2010
We (Mikael Nitell and me) got a whole track on the Norwegian MSDN Live tour this year. We did these as a pair, and covered 4 cities over 4 days, 6 sessions per day, taking 8 hours to come through it. The Islandic volcano made the travels a bit rough, but we managed 6 flights out of 8. The first one had to go by van instead, 7-8 hour drive each way together with other MSDN Live presenters – a memorable tour!
Code Contracts and Pex at MSDN Live 2010
One of the 6 sessions I and Mikael Nitell is running on MSDN Live 2010 here in Norway is about Code Quality, and part of that session goes through the use of Code Contracts and Pex. Both fantastic tools ! They can be used together, but are also completely independent from each other, and each can be used single.
Code Contracts has to downloaded separately from VS 2010 (works also on VS 2008). Start looking at http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx . This download is a free download. Code Contracts originates form the ideas of Bertrand Meyer – Design by Contract, take a look here.
How to enable Forms authentication in Team Foundation Server 2010 Web Access
Forms authentication is not what “they” normally recommend from a security point of view, but in some cases it solves access problems. Particularly for companies which doesnt allow the Windows authentication protocol to pass, and those companies do exist. To enable it in TFS 2010 is a bit more than a oneliner. The recipe below shows you how to enable it.
One has to change the web.config file for the Web Access. There are instructions within the file, but those instructions are incorrect and don’t work as intended. This is probably leftovers from the 2008 version.
How to fix annoying connection error to TFS server 2010 RC
This issue has popped up for some after having upgraded from Team System Beta 2 to RC. You have remembered to uninstall everything (as Jakob points out here: http://geekswithblogs.net/jakob/archive/2010/02/09/reember-to-uninstall-all-beta-2-stuff-before-upgrading-to.aspx but you still get the following error box:
saying Could not load type 'Microsoft.TeamFoundation.Client.TeamFoundationServerBase' from assembly 'Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
At the same time, you see Power Tools functions are still there in Visual Studio, but no Power Tool appears in the Add/Remove programs. This is some freak happening when uninstalling the beta Power Tools.
Free seminar on Visual Studio and TFS 2010 in Bergen with NNUG
We’re running a new 2.5 hour seminar on the new Visual Studio 2010 and Team Foundation Server 2010 in Bergen Jan 27th. See the agenda and invitation at the NNUG site. http://nnug.no/Avdelinger/Bergen/Moter/NNUG-Bergen---Januar-20092/
The seminar runs through a typical development cycle, and using demos demonstrates how Team System 2010 can be utilized to cover the whole lifecycle. The focus is on the new features in 2010, and we will try to cover as much ground as possible. The seminar is nearly power-point free and very developer friendly !
Free seminar on Visual Studio and TFS 2010 in Bergen with NNUG
We’re running a new 2.5 hour seminar on the new Visual Studio 2010 and Team Foundation Server 2010 in Bergen Jan 27th. See the agenda and invitation at the NNUG site. http://nnug.no/Avdelinger/Bergen/Moter/NNUG-Bergen---Januar-20092/
The seminar runs through a typical development cycle, and using demos demonstrates how Team System 2010 can be utilized to cover the whole lifecycle. The focus is on the new features in 2010, and we will try to cover as much ground as possible. The seminar is nearly power-point free and very developer friendly !
2010 Branching guidance released by the TFS Rangers team
A new version of the Branching guidance has been released (III), containing very good stuff on how to do branching. It includes labs, sketches and how-to’s.
See http://tfsbranchingguideiii.codeplex.com/
One of my favorites is the diagram poster shown below which I’ve used to explain the different branching strategies, and I find this very useful and easy to explain. You’ll find it in one of the tabs of the Visio file included in the download package.
2010 Branching guidance released by the TFS Rangers team
A new version of the Branching guidance has been released (III), containing very good stuff on how to do branching. It includes labs, sketches and how-to’s.
See http://tfsbranchingguideiii.codeplex.com/
One of my favorites is the diagram poster shown below which I’ve used to explain the different branching strategies, and I find this very useful and easy to explain. You’ll find it in one of the tabs of the Visio file included in the download package.
Team System Rangers releases TFS Quick Referene Guidance
The Team System Rangers (http://msdn.microsoft.com/en-us/teamsystem/ee358786.aspx) just released a set of real cool Quick Reference Guidance sheets for the Visual Studio 2010 Team System at Codeplex http://vs2010quickref.codeplex.com/. These guides collects up so much useful information in just a few slides. I’ve always loved the branching guidance overview slides, explains so much in so little space. Here is the same covering many more aspects. A few….well, few is perhaps not the right word…there are quite a bunch of them, within these areas:
Team System Rangers releases TFS Quick Referene Guidance
The Team System Rangers (http://msdn.microsoft.com/en-us/teamsystem/ee358786.aspx) just released a set of real cool Quick Reference Guidance sheets for the Visual Studio 2010 Team System at Codeplex http://vs2010quickref.codeplex.com/. These guides collects up so much useful information in just a few slides. I’ve always loved the branching guidance overview slides, explains so much in so little space. Here is the same covering many more aspects. A few….well, few is perhaps not the right word…there are quite a bunch of them, within these areas:
On branches and builds in Team Foundation Server
On codeplex the VSTS Rangers have published the Branching Guidance II (yes, a while ago, but still very true). The basic idea there is the separation between 3 major branches, the Main (or trunk), the Development and the Release branch. One can elaborate on these and use multiple Development branches, and also a tree of release branches, but the basic principle can be summed up with these three.
On branches and builds in Team Foundation Server
On codeplex the VSTS Rangers have published the Branching Guidance II (yes, a while ago, but still very true). The basic idea there is the separation between 3 major branches, the Main (or trunk), the Development and the Release branch. One can elaborate on these and use multiple Development branches, and also a tree of release branches, but the basic principle can be summed up with these three.
Team System 2010: Static Code Analysis, easier to set rules
In Visual Studio the settings for static analysis is done on the project property page, a tab called Code Analysis. You can set which code analysis rules you want to be active. The default in Visual Studio 2008 is to use all. If you run with this default setting you will generate a lot of "noise", since there are a large set of rules. You need to create a set containing the rules you and your team find are suitable for your organization and project. This set you have to apply to every C# project in your solution. In Visual Studio 2008 there is no easy way to do this. At Osiris we made an Addin to Visual Studio to ease this. We defined the set in a separate file, and used the Addin to apply that to all projects in a solution.
Team System 2010: Static Code Analysis, easier to set rules
In Visual Studio the settings for static analysis is done on the project property page, a tab called Code Analysis. You can set which code analysis rules you want to be active. The default in Visual Studio 2008 is to use all. If you run with this default setting you will generate a lot of "noise", since there are a large set of rules. You need to create a set containing the rules you and your team find are suitable for your organization and project. This set you have to apply to every C# project in your solution. In Visual Studio 2008 there is no easy way to do this. At Osiris we made an Addin to Visual Studio to ease this. We defined the set in a separate file, and used the Addin to apply that to all projects in a solution.
Mapping use cases to code
There has always been a controversy between modeling and coding. All from the point where models are to be turned into code automatically, through the state where models are written and then forgotten after coding has started, to the point where one generates models from the code.
To me, code and model is representations of the same thing - the problem to be solved, or the solution to the problem. And when the solution matches the problem, which sometimes happens, all is well.
Mapping use cases to code
There has always been a controversy between modeling and coding. All from the point where models are to be turned into code automatically, through the state where models are written and then forgotten after coding has started, to the point where one generates models from the code.
To me, code and model is representations of the same thing - the problem to be solved, or the solution to the problem. And when the solution matches the problem, which sometimes happens, all is well.
Use Cases, User Stories and Scenarios – what are they – and how do they relate to TFS 2010
All these three terms are used to describe the behavior of an application. They come from different process methodologies, and have different meanings, characteristics and are intended to be used differently.
Larry Guger also discuss these aspects and several others in his blog entries http://continuouslyintegrating.blogspot.com/2009/07/use-cases-and-visual-studio-2010-part-1.html and http://continuouslyintegrating.blogspot.com/2009/07/beginning-use-cases-identifying-actors.html.
The Use Case is the term used in UML and in the different Unified Process based methodologies. See http://en.wikipedia.org/wiki/Use_case for a good overall description. A use case is often looked upon as a more formal way of describing behavior, and which has to be accompanied by a detailed description following certain rules. However, a Use case can in fact be as light weight or as formal as one wants it to be. I find that this depends more on the process methodology one uses more than characteristics of the use case itself.
Use Cases, User Stories and Scenarios – what are they – and how do they relate to TFS 2010
All these three terms are used to describe the behavior of an application. They come from different process methodologies, and have different meanings, characteristics and are intended to be used differently.
Larry Guger also discuss these aspects and several others in his blog entries http://continuouslyintegrating.blogspot.com/2009/07/use-cases-and-visual-studio-2010-part-1.html and http://continuouslyintegrating.blogspot.com/2009/07/beginning-use-cases-identifying-actors.html.
The Use Case is the term used in UML and in the different Unified Process based methodologies. See http://en.wikipedia.org/wiki/Use_case for a good overall description. A use case is often looked upon as a more formal way of describing behavior, and which has to be accompanied by a detailed description following certain rules. However, a Use case can in fact be as light weight or as formal as one wants it to be. I find that this depends more on the process methodology one uses more than characteristics of the use case itself.
Defining the build set
A build set is a set of builds running on the same solution or set of solutions, catering for different aspects of the Continuous Integration process. Why a set of builds ? Because one size doesn't fit all. Something you want to run quickly and others you want to cover a lot of stuff. This can be divided into a set of aspects.
The aspects can be divided into three major parts:
Defining the build set
A build set is a set of builds running on the same solution or set of solutions, catering for different aspects of the Continuous Integration process. Why a set of builds ? Because one size doesn't fit all. Something you want to run quickly and others you want to cover a lot of stuff. This can be divided into a set of aspects.
The aspects can be divided into three major parts:
Article on Subsystem branching
I did an article on Subsystem branching (http://geekswithblogs.net/terje/archive/2008/11/02/handling-subsystem-branching.aspx) as a result of a post on the Microsoft forums regarding this.
Further, at the PDC 2008 conference now, Grant Holliday made me aware of the TFS Dependency Replicator, which also is a way to solve the problem. It corresponds to the solution I named Solution 3B, however, it's not using the branch/merge facilities, so the TFS itself is not "aware" of the file copied. Anyway, a great tool !
Article on Subsystem branching
I did an article on Subsystem branching (http://geekswithblogs.net/terje/archive/2008/11/02/handling-subsystem-branching.aspx) as a result of a post on the Microsoft forums regarding this.
Further, at the PDC 2008 conference now, Grant Holliday made me aware of the TFS Dependency Replicator, which also is a way to solve the problem. It corresponds to the solution I named Solution 3B, however, it's not using the branch/merge facilities, so the TFS itself is not "aware" of the file copied. Anyway, a great tool !