Question

I have a solution in Visual Studio 2012. It includes two projects for tests, one in F# and one in C#. I have installed NUnit and FsUnit as Nuget packages. After the installation, the references to these assemblies point to the dll's found in the \packages\ folder inside my solution. After I compile the solution, the references change in the F# project and point to the NUnit installed in my C:\Program Files (x86)\ folder and the \bin\Debug\FsUnit.NUnit.dll in my F# project. In the C# project the references keep pointing to the packages folder.

The project builds in Visual Studio and the tests run fine. When I build it in TeamCity it fails as it cannot find NUnit and FsUnit in the F# project.

Any ideas why the reference change when I compile?

Moreover, why the properties of a reference in an F# project contain much less information compared to the ones in a C# project?

Was it helpful?

Solution

To close this question, and for future reference, the references in the .fsproj were originally

<Reference Include="FsUnit.NUnit, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null">
  <Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.0.12051, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
  <Private>True</Private>
</Reference>

Following Brian's advice, I replaced them with the ones from the .csproj below

<Reference Include="FsUnit.NUnit, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\packages\FsUnit.1.1.0.0\Lib\Net40\FsUnit.NUnit.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=2.6.0.12051, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
  <HintPath>..\packages\NUnit.2.6.0.12054\lib\nunit.framework.dll</HintPath>
</Reference>

OTHER TIPS

This seems to be a bug in NuGet that affects only F# projects, and then only in VS 2012. You'll notice that if you ever use NuGet to upgrade to a newer version of NUnit or FSUnit, your HintPaths will once again be stripped from the .fsproj file.

http://nuget.codeplex.com/workitem/2149

Please vote for that issue so it hopefully gets some attention before the final release of VS 2012!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top