ALT.NET

Somehow the term ALT.NET has been created to describe people who use .Net to program, but try to avoid the “standard” practices and tools that microsoft pushes.

Roy Osherove has an article where he pits the HOT and NOT as seen by the alt.net guys.

My major issue with trying to adopt more of these practices is that I work mostly on existing large applications.

I can’t just show up at a client who already has millions of LOC using a more standard approach with thousands of stored procedures, and jump into a Monorail/NHibernate project.

For now I am focusing on getting one of my clients using a server based build and deployment.  We have already moved off of VSS, which is making a big difference in our productivity.

What Files Shoud Go In Source Control

I was searching for some guidance on this and came across a nice paper:

Explained :Structuring Your Solutions And Projects In Source control Using Team Foundation Server

What Files Should Be Source Controlled?

The following list identifies the key file types that you should add to source control. These are the file types that are added when you click Add Solution to Source Control.

Solution files (*.sln). Solution files maintain a list of constituent projects, dependencies information, build configuration details, and source control provider details.

Project files (*.csproj or *.vbproj). Project files include assembly build settings, referenced assemblies (by name and path), and a file inventory.

Visual Studio Source Control Project Metadata (*.vspscc). These files maintain project bindings, exclusion lists, source control provider names and other source control metadata.

Application configuration files (*.config). XML configuration files contain project and application specific details used to control your applications ’s run time behavior.

 

Web applications use files called Web.config. Non-Web applications use files called App.config.

Note: At run time, the Visual Studio build system copies App.config to your project’s Bin folder and renames it as Yourappname.exe.config. For non-Web applications, a configuration file is not automatically added to a new project. If you require one, add it manually. Make sure you call it App.config and locate it within the project folder.

Source files (*.aspx, *.asmx, *.cs, *.vb, …). Source code files, depending on application type and language.

Binary dependencies (*.dll). If your project relies on binary dependencies such as third party DLLs, you should also add these to your project within source control. For more information about managing dependencies, see “Explained: Managing Source Control Dependencies in Visual Studio Team System.”

What Files Should Not Be Source Controlled?

The following files are not added to source control because they are developer specific:

Solution user option files (*.suo). These contain personalized customizations made to the Visual Studio IDE by an individual developer.

Project user option files (*.csproj.user or *.vbproj.user). These files contain developer specific project options and an optional reference path that is used by the Visual Studio to locate referenced assemblies.

WebInfo files (*.csproj.webinfo or *.vbproj.webinfo). This file keeps track of a project’s virtual root location. This is not added to source control to allow individual developers to specify different virtual roots for their own working copy of the project. While this capability exists, you and all team members are recommended to use a consistent (local) virtual root location when you develop Web applications.

Build outputs that include assembly dynamic-link libraries (DLLs), Interop assembly DLLs and executable files (EXEs). Note that you are advised to add assemblies that are not built as part of your system build process (such as third-party controls and libraries) to Source Control within the projects that reference them.

Writing Tests that work in NUnit and MSTest

As someone who is trying to jump into the unit testing world, one of the major problems I had was deciding on using NUnit (which everyone uses) or use MSTest(built in).

I didn’t want to jump into this and realize 500 hours later that I picked the wrong framework.  Well, now it seems I don’t have to worry about that as much. 

First I was reading this article by Roy Osherove, and somehow I ended up on this page talking about converting between NUnit and VSTS projects, and from there I found a link to this page, which contained this great piece of code:

#If NUNIT Then
Imports NUnit.Framework
Imports TestClass = NUnit.Framework.TestFixtureAttribute
Imports TestMethod = NUnit.Framework.TestAttribute
Imports TestInitialize = NUnit.Framework.SetUpAttribute
Imports TestCleanup = NUnit.Framework.TearDownAttribute
#Else
Imports Microsoft.VisualStudio.TestTools.UnitTesting
#End If

This allows you do have the came code for NUnit and MSTest.  Just change the NUNIT variable and recompile.

The other thing you need to do is use <TestAttribute()> instead of <Test()> on your NUnit tests, but I don’t see the difference there.

 

Adding Static Code Analysis To Team System/TFS

So I have this problem.

If someone declares:

Public iProductId as Integer

then I want to be notified.  But if someone declares:

Protected WithEvents txtUserName as Textbox

I don’t want to be bothered.

Every control declaration we have throws an error in the static code analysis tools.

So after asking around, I guess it is not possible to cusomize the existing rules to exclude common prefixes such as lbl, txt, cmd etc.

So apparently the only option left is to disable those rules and create my own. 

So here are a few links that deal with creating custom links.

MSDN

Kevin Castle

FxCop Team

 

Roger Waters: Dark Side Of The Moon Live

So last nigth was the Dark Side of the Moon Live concert and it was really cool to see.

I started to really like Pink Floyd in college, which of course was after they had been broken up for years.

So even though Dark Side was one of my all time favorite CDs, I figured I woudl never have an opportunity to see it performed.

It was really cool to see this!

During the last 2 tracks, a rotating pirzm composed of lasers appeard above the crowd. 

Then for the last track, the fired a spotlight out of one side of it, and a colored laser spectrum out of the other.

In other words, they created a 3D rotating version of the logo seen above. 

It was amazing!  Now I have to decide if I want to go up to Wisconsin and see the show again in a month.

 

Team Foundation Server Power Tool and Forums

MS has released a power tool for TFS, and here are the MS hosted forums:

Team Foundation Server – General
Discuss Team Foundation Server general concepts.

Team Foundation Server – Setup
Discuss Team Foundation Server setup and configuration.

Team Foundation Server – Administration
Discuss Team Foundation Server administration and operations.

Team Foundation Server – Version Control
Discuss Team Foundation Version Control, including branching, merging, and shelving.

Team Foundation Server – Work Item Tracking
Discuss Team Foundation Work Item Tracking, including work item customization and Office integration.

Team Foundation Server – Reporting
Discuss Team Foundation Reporting, which uses SQL Server 2005 Reporting services to report team project metrics.

Team Foundation Server – Build Automation
Discuss Team Foundation Server’s build automation features.

Team Foundation Server – Process Templates
Discuss Team Foundation Server process template development and customization.

Running VSSConverter Against SQL Server 2005

The VSSConverter tool which allows you to convert from VSS to TFS will attempt to utilize a local version of SQL Express.

This sucks, as I hate SQL Express.

After some searching/trials/errors, I found a way to get it to work against a SQL Server 2005 database.

Just add the SQL tag to your migration settings xml file like so:

<Source name=VSS>

      <VSSDatabase name=D:Program FilesMicrosoft Visual SourceSafeVSSHttp></VSSDatabase>

      <UserMap name=D:VSS2TeamFoundationUsermap.xml></UserMap>

      <SQL Server=name_of_your_SQL_Server />

</Source>