Continuous Integration
TFS Build Not Publishing Web Applications
Jan 8th
_PublishedWebsites does not exist?! WHAT?! Huh?
One of our TFS builds was succeeding and a fellow developer noticed that the Web App was not getting copied into the _PublishedWebsites folder of our drop location.
I took a look at our TFSBuild.Proj file and I didn’t see anything that stood out. I took a look at a similar project who’s output was being copied into the _PublishedWebsites directory and the .proj file matched that of the one that did not work.
Solution
The problem was not in the .proj file, but in the actual .csproj file for the Web Applicaiton Project.
.csproj files ARE MSBuild files and inside of that I saw this:
<Import Project=”$(MSBuildBinPath)\Microsoft.CSharp.targets” />
<!–<Import Project=”$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0WebApplications\Microsoft.WebApplication.targets” />–>
The second Build target file was not getting loaded.
This build target file contains a target by the name of “_CopyWebApplication” which takes the output of the web application and copies it to the _PublishedWebsites directory.
I uncommented this line, checked it back into TFS and re-ran my build and my _PublishedWebsites started showing up.
My file now looks like this:
<Import Project=”$(MSBuildBinPath)\Microsoft.CSharp.targets” />
<Import Project=”$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0WebApplications\Microsoft.WebApplication.targets” />
Cruise Control.NET & Visual Source Safe – SS.EXE Hangs
Nov 30th
I recently help set up a CI (Continuous Integration) environment using CC.NET (Cruise Control.NET) at a client that I’m at. We’re in the process of implementing TFS (Team Foundation Server) but until some red tape is cleared we’re still stuck on VSS (Visual Source Safe).
While setting up the environment we were given a test VSS account to work with until everything worked as expected. Well the user they gave me had a blank password.
Example –
User: ccnet Pass: (no password)
The visual source safe source control block looked like this:
<sourcecontrol type=”vss” autoGetSource=”true” applyLabel=”true”>
<executable>C:\Program Files\Microsoft Visual Studio\VSS\win32\SS.EXE</executable>
<project>$/CCNET</project>
<username>ccnet</username>
<password> </password>
<ssdir>c:\repos\</ssdir>
<workingDirectory>c:\myBuild</workingDirectory>
<culture>en-us</culture>
<cleanCopy>false</cleanCopy>
</sourcecontrol>
When I fired up the CC.NET Service, everything started off fine. The project said “Checking For Modifications” and then it HUNG there, forever. It never stopped. I had to stop the service and then kill SS.exe (source safes process).
Solution
The reason this happened is because of this line:
<password> </password>
The password was left as ” “. It was a space. If I fired up VSS and typed in ccnet and put a space into the password, it would let me in, no problem. But if I did that with CC.NET SS.EXE would hang.
Pretty much, here’s what’s happening – Source Safe is firing up and its trying to log in and its giving an invalid password. SS.EXE is trying to raise a dialog box, but its running under the context of the Cruise Control.NET service, therefore it cannot open that dialog box.
I changed the password field to this:
<password></password>
and then it worked flawlessly.
Simple solution to a simple mistake.
.NET Scaffolding
Jun 21st
Jeremy D. Miller has a great post on keeping source code where it belongs. The thought process behind this is that code should be where YOU would assume it would be. If its data access code, it should be in a project/namespace that is something like Data Access or DAL or Data or something that represents the lower layer of the architecture. If its the business rules/tasks the files should be in a project called Business Rules, or BLL, or Tasks, or something similar. It makes sense, just think about this — if you walk into a business and are given a project that was created by another developer and you’re getting a ADO.NET Exception, you’d expect to find the code Data Access code in a Data Access layer, NOT in the code behind. I should not have to hunt down where you put your data access code.
We’re talking about basic separation of concerns. The thing is, many developers lack these concepts because they’re under the assumption of “I can write this the correct way, and it will take me 2 weeks, or I can do it quickly and it will take me 2 days.” This may not matter when the application is running for a few months, but when you are asked to change the data provider from SQL Server to Oracle, or remove the web service calls and replace them with RPC calls, you’re going to find yourself in a world of hurt because you didn’t set everything up correctly. At this point they have amounted a large amount of Technical Debt.
He also noted that a large number of people were now using Ruby On Rails (RoR) as their development platform and I won’t deny that I also believe that Ruby/Rails is huge right now. Tons of shops are running RoR and even Martin Fowler said on Hansel Minutes that ThoughtWorks was doing about 40% (or more) of their business with Ruby. The key point Jeremy brought up is that “RoR forces web developers into a bit of a straight jacket, but that’s a good thing in a way.” I completely agree. RoR enforces a consistent source code tree layout which allows for developers to easily find there way around a project. “Developer A” can create a project with RoR and then “Developer B” can come along and take a look at it and be familiar with the code layout and structure. The RoR community has agreed that this is the basic way to organize a project and it seems to be working for them.
So what about .NET? Enter Tree Surgeon. Right now, its a stand alone application, but in its near future it should be implemented as a template in Visual Studio 2005/2008. So what is it? It’s a application that will create that straight jacket that Jeremy spoke of. It gives the developer a basic set up of layers, unit tests, code coverage and build script. It builds the entire source code directory and allows you to build on top of it. The source code layout follows a white paper written by Mike Roberts. I’ve been using it for quite awhile and I’m one of the developers on the project. I recently updated the source to allow creation of Visual Studio 2005 projects. Please note, this is only on the source and has not been reflected on the production release. Download the source, run it and then choose a application name, and generate the project source directory tree. Open the solution file and your application is ready to go.
The best part is that its easy to integrate existing projects into this format. I’ve done it quite a few times to allow for easy integration into my clients CI environment.
If you have any requests for Tree Surgeon, please visit the Issue Tracker page and submit and issue.
Enjoy!
Teamprise Explorer Client vs. Visual Studio Team Explorer
Jun 7th
Over the weekend I had the time to work with Teamprise Explorer and Visual Studio Team Explorer while working on an open source project that I’m a part of. This was the first time I’ve worked with Teamprise explorer and Visual Studio Team Explorer. Since Codeplex houses its source on Team Foundation Server (TFS) I was required to use one of these options. This is a little look into my experience.
First off let me start by saying that I’m a Subversion junkie. I keep all of my own personal source code in Subversion and I’ve helped many clients implement Subversion in my time. I’m an avid user of TortoiseSVN because of its ease of use within Windows Explorer. Working with TFS was very similar to that of Subversion but the terminology was different and in my opinion Teamprise was a little more difficult to use. I originally wanted to use the Visual Studio Plug-in but I didn’t want to wait for the 246 MB file to download so I could install a plug-in. :\ Therefore, I went with Teamprise first. They will give you a free license to work with Codeplex if you’re working on a project, so that was a win/win for me.
Teamprise Explorer Client will allow you to connect to a Team Foundation Server to access source code (its user interface reminds of me of WinCvs quite a bit, yet a lot more polished than that of WinCvs). The only problem that I had with Teamprise is that when I went needed to edit the code I had to “Checkout for Edit”. If I did this on the entire directory tree such as my “src” directory it would log everything in edit mode. Therefore, when I went to upload the changes the entire source tree was being uploaded. NO BUENO. I know that on average I like to see what I’ve edited (yes, I’m used to TortoiseSVN) in some type of explorer window. This didn’t happen on Teamprise (maybe there is a way to see if a file has changed other than the Pending Changes window, if so, someone please let me know). In the end, I got frustrated, ended up clicking some button on Teamprise explorer and overwrote all my changes somehow. THAT SUCKS. I got frustrated and decided to download the plug-in and start working that way.
Visual Studio Team Explorer Plug-in was great. Its interface reminded me of the old days when I use to personally use Source Safe 6.0. The icons were similar and it was familiar ground. I think we may have a winner. After making my changes again I was able to easily see what changed through simple icon’s changing colors and I checked everything in really easily. It was very seamless. The only downside to Visual Studio Team Explorer is the install process. First you have download an IMG file, then download an install an IMG extractor and then open the IMG, then install. Only then did I get the full Visual Studio Integration. Very nice.
One downside that I see is that the Express SKU’s don’t allow plug-ins so this kind of sucks for those guys. How can you have an open source hosting site that doesn’t allow its users to easily get the source. Don’t get me wrong, they can use Teamprise but they have to know there is a learning curve with that. I didn’t have the patience for it this time around.
There is hope on the horizon though…
CodePlex will be offering TortoiseSVN Support to Team Foundation Server. Therefore you will be able to use a tool such as TortoiseSVN to access Team Foundation Server. Supposedly this is to be released on or around June 18th of this month. In a nutshell there will be a bridge built between SVN Commands and TFS commands. I would assume this is a good place for the Adapter pattern to be put to work.
Hopefully this comes to fruition, I can see a lot of people possibly moving their projects to CodePlex if that’s the case.
Tree Surgeon Development
Apr 16th

As of a couple weeks ago, I joined the Tree Surgeon open source project. Recently, Bil Simser took over the project and opened it up on CodePlex. The development team will be adding many new features to the application to help in the setup of the development tree structure and build integration process. Keep your eyes peeled!
