gpt4 book ai didi

c# - NUnit:无法加载文件或程序集 nunit.core

转载 作者:行者123 更新时间:2023-11-30 18:41:48 24 4
gpt4 key购买 nike

我在让 NUnit 与 MSBuild 一起工作时遇到了一些问题。我有得到 http://msbuildtasks.tigris.org/和以下构建文件:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="3rdparty\MSBuild.Community.Tasks\MSBuild.Community.Tasks.Targets"/>

<ItemGroup>
<TestAssembly Include="net.purpletube.minla.test\bin\Debug\*.test.dll" />
</ItemGroup>

<PropertyGroup>
<NUnit-ToolPath>3rdparty\NUnit\</NUnit-ToolPath>
</PropertyGroup>

<Target Name="Tests">
<NUnit Assemblies="@(TestAssembly)" ToolPath="$(NUnit-ToolPath)" />
</Target>
</Project>

我得到的错误是:

3rdparty\NUnit\nunit-console.exe /nologo net.purpletube.minla.test\bin\Debug\net.purpletube.minla.test.dll ProcessModel: Default DomainUsage: Single Execution Runtime: Default Could not load file or assembly 'nunit.core, Version=2.5.9.10348, Culture=neu tral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The system
cannot find the file specified.

nunit.core 位于 3rdparty\NUnit\lib 并在以下位置运行 nunit-console它自己的命令行很好,但如果我指定测试程序集,我得到错误。以下文章:

http://nimtug.org/blogs/damien-mcgivern/archive/2006/05/17/Could-not-load-file-or-assembly-nunit-core.aspx

表明这可能是我的测试程序集有问题,但我看不到任何东西。

有没有其他人看到并解决了这个问题?

最佳答案

试试 Fusion 日志查看器,
http://msdn.microsoft.com/en-us/library/e74a18c4(v=VS.100).aspx它将向您显示正在加载或未能加载的程序集,以及它用来解决这些问题的位置。

一旦您弄清楚它实际上在哪个文件上失败,它可能会提供额外的线索。

关于c# - NUnit:无法加载文件或程序集 nunit.core,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6404972/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com