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.”
And in the Code Analysis window you will get the “CA0053 Error running code analysis” with its “Unable to load rule assembly”.
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
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.
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
Queue Default Build(s): This starts the default build directly, no dialog pops up. Less clicks! Another cute thing here is that if you select a folder, it will start all the builds in that folder directly.
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.
The Build explorer is based on using a convention of separators in the build definition names. See Brian Harry’s blog for a nice explanation and description of this.
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.
saying “Could not load file or assembly ‘0 bytes from System, Version=4.0.0.0,……..”
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
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 be downloaded separately from VS 2010 (works also on VS 2008). Start looking at Code Contracts on MSDN. This download is free. Code Contracts originates from 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 !
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 Quick Reference Guidance sheets for Visual Studio 2010 at Codeplex: http://vs2010quickref.codeplex.com/. These guides collect a lot of useful information in compact slides and cover many areas.
- Planning:
- Design
- Dev Debug
- Database
- Testing
- Build
- General
The guides are rather detailed and can be used as “cheat” sheets, so I’ll just drop one of them as an example, download them and get the whole set:
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 published the Branching Guidance II: Branching Guidance II. The basic idea is separation of three major branches: Main (trunk), Development and Release. You can elaborate with multiple development branches and a tree of release branches, but the principle can be summarized with these three.
Now, if we look at the different sets of build types we have, see http://geekswithblogs.net/terje/archive/2009/02/04/defining-the-build-set.aspx for details, and combine this information with the branching model above, we can see what types of builds should be set up for each branch. I’ve used the terms None, Mandatory and Optional to indicate the relationships.
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.
In Team Foundation Server 2008 we shipped a “branches” feature (some people call them “branches and merges”). The idea is that a developer who wants to develop a new feature can branch the main development line and work in the branch without affecting the main development line.
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. 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 Use cases and Visual Studio 2010 - Part 1 and Beginning use cases - identifying actors.
The Use Case is the term used in UML and in the different Unified Process based methodologies. See 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 (original article on GeeksWithBlogs) 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!