运行NUnit时加载程序集的问题(FileNotFoundException) [英] Problem with loading assembly when running NUnit (FileNotFoundException)

查看:122
本文介绍了运行NUnit时加载程序集的问题(FileNotFoundException)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我一直在使用Selenium记录一些简单的测试.尽管Selenium测试最初存储为html文件,但该程序允许您以多种语言(在这种情况下,我使用C#)导出测试用例.

我下载了NUnit用作测试框架-然后可以将特定的导出C#文件作为项目加载到NUnit中.

我还创建了一个简单的Web应用程序,可在其中单击一个按钮以启动NUnit并运行一些测试.问题是,我不断收到此错误消息:

System.IO.FileNotFoundException:找不到文件或程序集名称nunit.core或其依赖项之一.

一旦退出该弹出窗口,NUnit就会根据需要打开,但是不会加载测试. Web应用程序背后的源代码如下所示:

Recently, I''ve been using Selenium to record a few simple tests. Although Selenium tests are initially stored as html files, the program allows you to export the test cases in a variety of languages (in this case, I''m using C#).

I downloaded NUnit to use as my testing framework -- I can then load a particular exported C# file into NUnit as a project.

I also created a simple web app where I can click a button to launch NUnit and run a few tests. The problem is, I keep getting this error message:

System.IO.FileNotFoundException : File or assembly name nunit.core, or one of its dependencies, was not found.

Once I exit out of this popup, NUnit opens as desired, however, the tests don''t load. The source code behind the web app looks like this:

public void ButtonClick1(object sender, System.EventArgs e)
{
   ProcessStartInfo proc1 = new ProcessStartInfo("C:\\selenium-remote-control
1.0.3\\selenium-dotnet-client-driver-1.0.1\\source\\tools\\nunit\\nunit-gui", "TestProject14.dll");

   System.Diagnostics.Process.Start(proc1);
}



基本上,我只是试图创建一个新的进程,该进程将启动NUnit gui并运行测试.我不确定它是否找不到.dll还是其他问题.

任何帮助将不胜感激-这是我的第一篇文章,因此,如果我遗漏了一些完全显而易见的内容,请提前致歉.谢谢!



Basically I''m just trying to create a new process which launches the NUnit gui and runs the test. I''m not sure if it can''t find the .dll or if it''s some other issue.

Any help would be appreciated -- this is my first post, so if I''m missing something completely obvious, I apologize in advance. Thanks!

推荐答案

尝试一下:

try this:

public void ButtonClick1(object sender, System.EventArgs e)
{
   ProcessStartInfo proc1 = new ProcessStartInfo(@"C:\\selenium-remote-control
1.0.3\\selenium-dotnet-client-driver-1.0.1\\source\\tools\\nunit\\nunit-gui", "TestProject14.dll");
   System.Diagnostics.Process.Start(proc1);
}


这篇关于运行NUnit时加载程序集的问题(FileNotFoundException)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆