Thursday, April 16, 2009

TFS InvalidProgramException (or why software you need to install is stupid)

We are trying to includes some code that we keep in TFS source control into our builds. We also use code from AccuRev and SourceSafe. So we wanted to keep our existing build process and just have it include the TFS code instead of moving to an entirely TFS based build system.

So, like with any new tool we are including in our build process, I install it (in this case the TFS SDK) locally on my machine, get the DLLs from it and dumped them into our externals folder in AccuRev. Then I coded up the TFS integration piece and wrote some tests and everything looks like it was going wonderfully.

Then I tried to do a build on our build farm. The first call to TFS (TeamFoundationServerFactory.GetServer in this case) yielded:
Unhandled Exception: System.InvalidProgramException: Common Language Runtime detected an invalid program.
at Microsoft.TeamFoundation.Client.TeamFoundationServerFactory.GetServer(String name)

what the heck? Turns out the most common reason get this error is the TFS and x64 machines don't play well together. But in my case it was because I didn't have TFS installed on the machine I was tyring to run it on.

This is a huge pain in the butt. We build lots of versions of our software, we need to make sure that 3 years from now when we need to re-build the version from toady it will work fine. But if I have to install it on the machines instead of checking it in to source control this becomes very hard. What happens when Microsoft release an SP that changes something? What happens when TFS 2010 comes out and isn't able to install side by side with the 2008 version?

Please, please, if you are making software, especially software used for software development, make sure it can be deployed via xcopy.

Another case of this is Dofuscator, we use it now on one machine, we are pretty happy with. We would like to scale it out to all of our machines but you need to install it and register it on each machine to make it work. This is a deal breaker for us. They just a lost a bunch of licences.

I get that some programs want to control your usage of their product. But allow people to by a site licence and then deploy that via xcopy. Its more work but it will make your customers a lot happier.

0 comments: