Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 122357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:06:57+00:00 2026-05-11T04:06:57+00:00

I am learning how to use NUnit. I have my main project in it’s

  • 0

I am learning how to use NUnit. I have my main project in it’s solution, and created a separate project in that same solution which will hold my unit tests, with it’s own namespace. From that project I add a reference to the main project and add a

using MainProjectNamespace; 

to the top of it.

When I go to NUnit, any tests I have that don’t reference the main project work. These are tests I setup just to get used to NUnit, and are pretty much useless. When NUnit runs the real tests the test throws this exception:

TestLibrary.Test.TestMainProject: System.IO.FileNotFoundException : Could not load file or assembly ‘WpfApplication2, Version = 1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the specified file.

Why am I getting this exception?

EDIT:

Now when I try to load the assembly into NUnit, it won’t even load (so I can’t even get a chance to run the tests)

This is the Exception that come sup, and the stack trace:

System.IO.DirectoryNotFoundException: Could not find a part of the path ‘LONG PATH HERE I DON’T WANT TO TYPE’

System.IO.DirectoryNotFoundException...  Server stack trace:      at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)     at System.IO.Directory.SetCurrentDirectory(String path)     at NUnit.Core.DirectorySwapper..ctor(String directoryName)     at NUnit.Core.Builders.TestAssemblyBuilder.Load(String path)     at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)     at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)     at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)     at NUnit.Core.SimpleTestRunner.Load(TestPackage package)     at NUnit.Core.ProxyTestRunner.Load(TestPackage package)     at NUnit.Core.ProxyTestRunner.Load(TestPackage package)     at NUnit.Core.RemoteTestRunner.Load(TestPackage package)     at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)     at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)     at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)  Exception rethrown at [0]:      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)     at NUnit.Core.TestRunner.Load(TestPackage package)     at NUnit.Util.TestDomain.Load(TestPackage package)     at NUnit.Util.TestLoader.LoadTest(String testName) 

EDIT2: The above path clearly IS in my hard drive

EDIT3: I just switched from Debug to Release, on NUnit, and loaded the dll from the release folder of TestingLibrary… And it loaded! 1 of the 3 namespace-specific tests worked. Getting somewhere, I am.

EDIT4: Welllllllll… I can actually run the tests now, but I am back to the original error. IT is not finding the assembly for the main project

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T04:06:58+00:00Added an answer on May 11, 2026 at 4:06 am

    The compiler removes all unused references, and doesn’t deploy the dll unnecessarily. A using (by itself) does not count as a use. Either mark the dll for deployment via the ‘Copy to output directory’ setting, or add some code that really uses types declared in the dll.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning to use Core Data. I have created a data model etc
I am learning to use LabVIEW as part of my honours project, and was
I have been learning to use Emacs for a little while now. So far
I am learning to use mysql for rails apps, and I finally have been
I'm new to unit testing, and I'm learning how to use NUnit and Moq.
I am learning to use DelgateCommand from Prism.... In my UI, I have my
I am learning to use sed and have a hypothetical requirement: bash$ cat states
I am learning to use Processing , and have modified one of the examples
Ok I am learning to use databases in android and have follow several tutorials
im learning to use openGL and iv been told that because my wheel arches

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.