使用 Mono 运行 nunit-console.exe 的问题
我可以为 NUnit NUnit test under mono 制作一个 dll,但是当我尝试运行时nunit-console.exe 我收到以下错误消息。
Runtime Environment - OS Version: Unix 10.3.0.0 CLR Version: 2.0.50727.1433 ( 2.6.4 (tarball Thu Apr 22 13:24:33 MDT 2010) ) ProcessModel: Default DomainUsage: Single Execution Runtime: mono-2.0 ** (/Users/smcho/bin/NUnit-2.5.5.10112/bin/net-2.0/nunit-console.exe:36800): WARNING **: The following assembly referenced from /private/var/folders/m4/m4u1hmP+FHOQaiZbHj1UCk+++TI/-Tmp-/nunit20/ShadowCopyCache/36800_634111616836311880/Tests_-22323139/assembly/shadow/54274fc2/118e035c_45a94c9e_00000001/mut.dll could not be loaded: Assembly: nunit.framework (assemblyref_index=1) Version: 2.5.5.10112 Public Key: 96d09a1eb7f44a77 System error: Invalid argument ** (/Users/smcho/bin/NUnit-2.5.5.10112/bin/net-2.0/nunit-console.exe:36800): WARNING **: Could not load file or assembly 'nunit.framework, Version=2.5.5.10112, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies.
可能出了什么问题?我在 /Users/smcho/bin/NUnit-2.5.5.10112/bin/net-2.0/framework 下有 nunit.framework.dll,但它似乎不知道这一点。
I could make a dll for NUnit NUnit test under mono, but when I tried to run in with nunit-console.exe I get the following error message.
Runtime Environment - OS Version: Unix 10.3.0.0 CLR Version: 2.0.50727.1433 ( 2.6.4 (tarball Thu Apr 22 13:24:33 MDT 2010) ) ProcessModel: Default DomainUsage: Single Execution Runtime: mono-2.0 ** (/Users/smcho/bin/NUnit-2.5.5.10112/bin/net-2.0/nunit-console.exe:36800): WARNING **: The following assembly referenced from /private/var/folders/m4/m4u1hmP+FHOQaiZbHj1UCk+++TI/-Tmp-/nunit20/ShadowCopyCache/36800_634111616836311880/Tests_-22323139/assembly/shadow/54274fc2/118e035c_45a94c9e_00000001/mut.dll could not be loaded: Assembly: nunit.framework (assemblyref_index=1) Version: 2.5.5.10112 Public Key: 96d09a1eb7f44a77 System error: Invalid argument ** (/Users/smcho/bin/NUnit-2.5.5.10112/bin/net-2.0/nunit-console.exe:36800): WARNING **: Could not load file or assembly 'nunit.framework, Version=2.5.5.10112, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies.
What might be wrong? I have nunit.framework.dll under /Users/smcho/bin/NUnit-2.5.5.10112/bin/net-2.0/framework, but it doesn't seem to know about this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是在 Mono 中使用 NUnit 的另一个令人沮丧的点。据我所知,您需要将所有丢失的文件(不仅仅是
nunit.framework.dll
)放在与nunit- 相同的目录中控制台.exe
。在
mono
或nunit-console.exe
中可能有一个命令行选项来指定另一个目录来搜索丢失的 DLL - 我不确定。除此之外,您必须将丢失的 DLL 复制到与 nunit-console.exe 相同的文件夹中,或者您必须 cd 到框架中 文件夹并使用mono ../nunit-console.exe /path/to/my/tests.dll
This is another frustrating point about using NUnit in Mono. As far as I've been able to tell, you need to have all of those missing files (there will be more than just
nunit.framework.dll
) in the same directory asnunit-console.exe
.There might be a command line option either in
mono
ornunit-console.exe
to specify another directory to search for missing DLLs -- I'm not sure. Barring that, you'll have to copy the missing DLLs into the same folder asnunit-console.exe
, or you'll have tocd
into theframework
folder and usemono ../nunit-console.exe /path/to/my/tests.dll
安装 nuget 后,您可以使用它来安装 nunit.console,如下所示:
(这来自我的 .circlci/config.yml 文件)
诀窍是指定 NUnit.ConsoleRunner 的完整路径并注意
-
更改为.
按版本 3Once nuget is installed, you can use it to install nunit.console like so:
(This is from my .circlci/config.yml file)
The trick is to specify the entire path for the NUnit.ConsoleRunner and to watchout for the
-
changing into a.
by version 3