Here's how I built both FitNesse and FitLibrary for .Net 2.0. (If you don't have fifteen minutes for this, help yourself to my .Net FitNesse replacement bundle.)
UPDATE 25OCT2006: These instructions for building FitNesse may not work. Around May 2006, the developers of FitNesse merged their .Net FitServer with FitLibrary.NET into a new SourceForge project. (See the .Net page at FitNesse for more information.) I will try to investigate this, but I make no promise of updating these instructions.
First, let's tackle FitNesse:
- Download the latest source bundle for FitNesse. As of today, the latest version is 20060209.
- Create a directory in your "Visual Studio 2005\Projects" directory called "FitNesse".
- From the FitNesse source bundle, extract the contents of the "dotnet" directory (but not the directory itself) into the folder you just created.
- Open the "fitnesse.sln" solution file. This will start VS 2005 and invoke the Conversion Wizard.
- Click the "Finish" button, and the wizard converts the solution into one compatible with VS 2005.
- Click the "Close" button. If VS displays the conversion summary, then it encountered errors. Scan for the errors and resolve them. If the conversion had no errors, then VS will not display this summary.
- If you're using the same FitNesse version as I did, then you will see two errors in the summary regarding "TableFixture.cs" and "TableFixtureTest.cs". The errors occurred because, for some reason, the two files did not make it into the source bundle. Grab them from the latest release source bundle, and put them into the "fitnesse" folder in the "fit" project.
- In each of those files, add a
using fit;
line and change the namespace fromfit
tofitnesse.fixtures
. - For each project:
- Right click the project, and choose "Properties" from the context menu.
- In the properties page that appears, click the "Build Events" tab.
- Delete the pre-build event command line.
- Change the post-build event command line to
copy "$(TargetPath)" "$(SolutionDir)" copy "$(TargetPath)" "full path to FitNesse 'dotnet' directory"
including the double quotes.
- Build the solution. (Press F6.) You should see no errors, but you may get warnings. I addressed one of the two that appeared for me. I changed a method call from
GetByHostName
toGetHostEntry
.
And now for FitLibrary:
- Download the latest bundle of the .Net version of FitLibrary. As of today, the latest version is 20060117.
- Extract the contents of the bundle to your "Visual Studio 2005\Projects" directory. This will add a "FitLibrary.NET" project folder.
- Open the "fitlibrary.sln" solution file, and VS 2005 will start its Conversion Wizard.
- Click "Finish", and click "Close" when the wizard finishes. If you get errors, address them now. (I did not get any errors.)
- For the "FitLibrary" project:
- Right click the project, and choose "Properties" from the context menu.
- In the properties page that appears, click the "Build Events" tab.
- Delete the pre-build event command line. No longer necessary (25OCT2006)
- Change the post-build event command line to
copy "$(TargetPath)" "full path to FitNesse 'dotnet' directory"
including the double quotes. (Updated 25OCT2006)
- In the "FitLibrary" project, remove the reference to "fit", and add a reference to the "fit.dll" in your FitNesse installation's "dotnet" directory.
- Build the solution. (Press F6.) It should succeed.
Now you have a .Net 2.0 compatible version of FitNesse and FitLibrary ready for you in your FitNesse installation. Happy Testing!
Wow! Thank you, Paul, for your great effort porting those examples. Very helpful, indeed.
ReplyDeleteI'm getting "WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN" when it tries to find the fit.dll. I've tried your bundle as well as build my own. Anyone else have this issue?
ReplyDeleteJeff, thanks a lot. You made my day ... was stuck with finding a compatible version of FitNesse with .Net 2.0
ReplyDeleteYou're welcome, Sameer. I'm glad I could help.
ReplyDeleteI am having trouble the TestRunner. I am getting a socket exception. Anyone else?
ReplyDeleteAndy O. Try to recreate a strong name with some like this: sn.exe -k c:\fitnesse.key, and replace the wrong key.
ReplyDeleteI download from subversion the last version of fitnesse for dotnet. I want to recompile for .net 2.0. On the FitServer project i don't find PathParser.cs.
ReplyDeletePlease, do you know where i can find it?
thanks in advance.
I tried following your steps. I was not able to find "fitnesse.sln" so I downloaded your version of Fitnesse.net. Then I worked on the FitLibrary, the conversion worked fine. I created a Fitnesse directory and put the "dotnet" folder files there and have a FitLibrary.Net folder under Fitnesse.
ReplyDeleteIn post build the link of dotnet is to fitnesse installation in "My Documents" where I have my Fitnesse running.
I get following errors.
[1] "fit.FlowFixtureBase.LoadFixture(fit.Parse)': no suitable method found to override". File is "FlowFixtureBase.cs"
[2] "Metadata file 'C:\Program Files\Microsoft Visual Studio 8\Projects\Fitnesse\FitLibrary.NET\FitLibrary\bin\Debug\FitLibrary.dll' could not be found"
Any help is appreciated.
Thanks
Anonymous,
ReplyDeleteMake sure that you've extracted the contents of my dotnet.zip file into the dotnet directory of your Fitnesse installation. I have no problem building FitLibrary with the fit.dll from that zip file.
Everyone,
In response to the previous anonymous comment, I reviewed my instructions, and I found two interesting changes. First, during the last several months, the developers of FitNesse merged their .Net FitServer with FitLibrary.NET into a new project on SourceForge. Second, perhaps Rick Mugridge read this post because FitLibrary now builds without changing the project properties; however, you still must add that second post-build command line to copy the build output to your Fitnesse installation.
For fit.dll and runFile.exe without FitNesse or FitLibrary: in order to run fixtures compiled for .NET 3.5, which do use Linq, I had to recompile fit.dll and runFile.exe for the 3.5 platform.
ReplyDelete