Jump to content

Problem with loading assembly when running NUnit (FileNotFoundException)

- - - - -

  • Please log in to reply
1 reply to this topic

#1
erinpzk

erinpzk

    Newbie

  • Members
  • Pip
  • 1 posts
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:
Collapse

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);

}


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!

#2
fayyazlodhi

fayyazlodhi

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 403 posts
It Looks to me that you cannot launch a process explicitly with that info. API exist to do that implicitly and probably does more than just a new process. You should probably use:

Assembly.GetExecutingAssembly().Location // for console

But since you are working on GUI so probably (having added ref to nunit-gui-runner.dll)

Assembly.GetExecutingAssembly().Location, "/run" should be passed to respective API

for details take a look at following stackoverflow threads
c# - How to run NUnit programmatically - Stack Overflow
and
NUnit assembly not found - Stack Overflow




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users