[英]FsUnit, NUnit references in an F# project
我在Visual Studio 2012中有一个解决方案。它包括两个测试项目,一个在F#中,一个在C#中。 我已经将NUnit和FsUnit安装为Nuget包。 安装之后,对这些程序集的引用指向我的解决方案内的\\packages\\
文件夹中的dll
。 编译解决方案后,引用在F#项目中发生更改,并指向我的C:\\Program Files (x86)\\
文件夹中安装的NUnit和我的F#项目中的\\bin\\Debug\\FsUnit.NUnit.dll
。 在C#项目中,引用继续指向packages文件夹。
该项目在Visual Studio中构建,测试运行良好。 当我在TeamCity中构建它时失败,因为它在F#项目中找不到NUnit和FsUnit。
我编译时为什么引用会改变的想法?
此外,为什么F#项目中的引用属性与C#项目中的引用属性相比包含的信息要少得多?
要关闭此问题以及将来参考, .fsproj
中的引用最初是
<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>
按照Brian的建议,我将它们替换为下面的.csproj
中的那些
<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>
这似乎是NuGet中的一个错误,只影响F#项目,然后仅在VS 2012中。您会注意到如果您使用NuGet升级到更新版本的NUnit或FSUnit,您的HintPath将再次被剥离.fsproj
文件。
http://nuget.codeplex.com/workitem/2149
请投票支持该问题,以便在VS 2012最终发布之前获得一些关注!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.