Geeks With Blogs

News Subscribe

Delicious Save this on Delicious Visual Studio Feeds


Terje Sandstrom ------ Visual Studio ALM MVP ----- Code Analysis
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. When you suspect a memory leak, the immediate impulse would ......

Posted On Sunday, November 27, 2011 10:10 PM

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. ......

Posted On Thursday, October 14, 2010 12:21 PM

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 ......

Posted On Sunday, July 12, 2009 11:41 AM

Hiding generated code from Code Analysis, Metrics and Test Coverage
When I do either Code Analysis, Code Metrics or looking at Code Coverage results, I don't want to have any generated code affecting the results. It just confuses the numbers, and I do not really care how generated code looks - it should just be invisible. Generated code appears several places, code is generated by any of the multitude of wizards and designers in Visual Studio, or it may be generated by a 3rd part tool or generated by a self-written tool. There exist an attribute which, if attached ......

Posted On Monday, November 10, 2008 3:09 AM

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”. This means the project is bound to Visual Studio 2010, where it should ......

Posted On Saturday, August 18, 2012 9:24 PM

Video on Architecture and Code Quality using Visual Studio 2012–interview with Marcel de Vries and Terje Sandstrom by Adam Cogan
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 ......

Posted On Sunday, June 24, 2012 7:40 PM

Copyright © terje | Powered by: | Join free