Remove Items From ItemGroups In MSBuild

Software Development, Team System March 25th, 2008

The ability to remove entries from ItemGroups is one of the new features of MSBuild 3.5.

To remove an Item from an ItemGroup in MSBuild 2.0 you would have to create a new ItemGroup from the old one and skip the Item that you needed removed.

In MSBuild 3.5 we can achieve it by using the Remove parameter.

Example:

<ItemGroup>    <Files Include="a.cs" />    <Files Include="b.cs" />    <Files Include="c.cs" />    <Files Include="d.cs" />    <Files Include="e.cs" />    <Files Include="f.cs" />    <Files Include="g.cs" /></ItemGroup>

Some times we want to restrict some data from this group in a target. In order to do it,  we should use the Remove parameter:

<ItemGroup>    <Files Remove="a.cs" />    <Files Remove="e.cs" />    <Files Remove="f.cs" /></ItemGroup>

Read more at msdn.

Tags: , ,

Visual Studio Team System Chat scheduled for 9-Apr-2008

Team System March 25th, 2008

Do you want to get answers to your toughest questions from the Visual Studio and TFS product teams? Well, join the next product group chat in April 9th. (Read here previous chat summary).

Here are the particulars, from Jeff Beehler’s blog:

Join members of the Visual Studio Team System product group to discuss features available in Team Foundation Server, Team Suite, Architecture Edition, Development Edition, Database Edition, and Test Edition. In addition, discuss what’s new for these editions for Visual Studio 2008.

Add to Calendar

April 9, 2008
10:00 A.M. Pacific Time
Additional Time Zones

Tags:

NDepend – Great Static Analyzer

Software Development, Team System March 20th, 2008

Few week ago, I’ve been asked by Patrick Smacchia, a C# MVP to try this tool. I really want to thanks Patrick to give me the chance to evaluate a professional edition.

I installed it and start working with. After using this tool, it’s my most favorite tool to reviewing my code!

NDepend is an excellent tool that is designed to provide a very deep analysis of your compiled code to help you understand and control your development effort by managing both the quality and the complexity of your code. NDepend works in a very similar way as the Microsoft FxCop tool, by analyzing your compiled code and calculating different metrics and statistics on that code.

NDepend analyzes your code against more than 60 different metrics and can be customized to a particular application. These metrics measure things like:

  • Lines of Code, Comments and the percentage of comments
  • Number of IL instructions
  • Number of Assemblies, Namespaces, Types, Methods, Fields
  • Coupling (both Afferent and Efferent), Cohesion and Cyclomatic Complexity
  • Instability
  • Abstractness
  • Depth of Inheritance

NDepend’s start page:

Start Page

NDepend’s analyzing result and projects loaded:

Analyzing Result

A great feature is the NDepend’s CQL (Code Query Language). It is the one of its main features that I love.  It’s a query language for code so one can issue statements like:

SELECT TOP 100 METHODS ORDER BY NbLinesOfCode DESC

Its great to query your code this way, besides we’re all familiar with T-SQL… :)

Visual NDepend also has this metrics view which graphically represents any criteria from number of lines of code such as represented below, to number of methods, parameters, coupling, etc.  The bigger the square below means more number of lines of code.

Another feature for the professional edition (not available in the free edition) is the build comparisons.  It basically analyzes two build versions, analyze what’s been deprecated, broken, etc.  It’s useful to easily know if an upgrade to a component you’re using will break your app.  It also provides easy access on the details of what has been changed.

The binaries also include extensions for MSBuild, NAnt and CruiseControl.NET so you can readily include NDepend tasks in your build scripts for your continuous integration setup.

NDepend is great for architects or even team leads who wants to have a quick overview of their project rather than diving into the code and scratch their heads.

Addins of NDepends available to VS2008, VS2005 and Reflector.

NDepends web site: http://www.ndepend.com/

Tags: , , ,

Want to Meet Me at TechEd?

Community, Team System March 19th, 2008

As you know, I will be presenting a presentation in TechEd 08 Israel.  Microsoft opened up the meetings application at http://www.face2facemeeting.com/teched/.

If you are attending TechEd 08 Israel , you can set an appointment with me, by using this application.sign_party

To find me there navigate to the Find Participants screen and looking for ALM or מאור as keyword.

My presentation details:

  • Name: ALM403: Control your Database Lifecycle with Data Dude
  • Time: 8/4/2008, 9:00 AM
  • Location: Hilton Hotel, Ofir-Adom Hall

I’m always happy to answer questions – so come meet me in Tech Ed, and let me know how you liked my presentation!

Tags: , , , ,

Running Tests On TFS Build Machine

Team System March 13th, 2008

Often I asked “What do I need to install on the TFS build machine in order to run tests?”

Well, the answer is simple.

In VSTS 2005 you have to install the Tester or Suite editions on the Build Machine to run tests (even Unit Tests).

In VSTS 2008 installing the Developer Edition version is enough.

Tags: , , ,

VSDB 2005 Service Release 1 (SR1) Rollup Package 1

Team System March 12th, 2008

Visual Studio 2005 Team System Database Professional post Service Release 1 (SR1) roll-up package 1, is now available.

Problems that are fixed:

  • Inconsistent revalidation of database object definitions when you close and then reopen a Visual Studio database project
  • A database project cannot be deployed if the project contains interdependent inline functions
  • If you use a four-part name to reference a table, you may receive an incorrect syntax exception
  • Database Professional Interpreter does not handle the “sp_executesql” parameter correctly
  • In a Visual Studio 2005 database, you cannot import a schema that was created by using the SQL Server 2000 compatibility mode
  • Error message when you use Design-Time Extensibility (DTE) objects: “Do you want to reload”
  • Cross-database references cause slow performance when you load a project
  • Schema Compare crashes the Visual Studio IDE when databases contain different versions of assemblies
  • Schema Compare does not correctly generate the update script for a stored procedure
  • The schema script is not generated when triggers or views that have the same name exist
  • Error message when you build a deployment script: “MSB4018: The ‘SqlBuildTask’ task failed unexpectedly”
  • After Schema Compare obtains the latest project files from Source Control, Schema Compare indicates that databases are different

For more details, see knowledge base article KB941278.

You can download the roll-up from the Microsoft Connect site at:
http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=11229

Tags: ,