Home > Errors > Are you unable to load due to AppBase location issue in NUnit?

Are you unable to load due to AppBase location issue in NUnit?

Error

I have been getting this error lately: System.ApplicationException: Unable to load ‘NUnitAssemblyName’ because it is not located under the AppBase—->
System.IO.FileNotFoundException: Could not load file or assembly ‘NUnitAssemblyName” or one of its dependencies. The system cannot find
the file specified.

Environment

  • Windows 7 32-bit
  • NUnit version 2.5.3.9345
  • Visual C# Express 2010
  • .Net Framework 4

Screenshot from NUnit:

Solution

So I made up my mind to get to the bottom of it. Apparently, to solve the puzzle was staring me right in the face and it is quite simple as:

  1. In NUnit, click Project -> Configurations and set the applicable build type for your NUnit project.
  2. Click Project -> Edit… and click ApplicationBase browse button and point the location to your NUnitProject_directory\bin\<Build_Type>, where Build_Type could be Debug, Release, etc.
  3. In the future, as soon as you create your NUnit project, be sure to take steps 1 and 2 before adding your NUnit assembly.

That’s it. Hopefully this hint will save someone trouble for the day!

Categories: Errors Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: