[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 581
  • Last Modified:

NUnit failing to load file

Hi,  I am new to NUnit (just installed it tonight) and i am having some problems with it.

I can compile/run/use my app without problems but when i run it through NUnit it tells me:

WindowsApplication1.Tests.parseDomainFromURL : System.IO.FileNotFoundException : Could not load file or assembly 'Parser, Version=1.0.2382.42406, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

"Parser" is a separate library i made a while ago (using .NET 1; the app i am building is in .NET 2 if that matters).  The tests i wrote before i added this reference worked just fine.

Now the tests that use objects created from Parser classes fail with the above error (but with different test names, they arent all called parseDomainFromURL  :)

Functions that do not use the Parser classes still pass.  Can anyone tell me how to get NUnit to work with this app?
-Thanks
0
dave4dl
Asked:
dave4dl
  • 7
  • 6
1 Solution
 
Bob LearnedCommented:
Which version of NUnit are you using?

Bob
0
 
dave4dlAuthor Commented:
I just downloaded it today so i assume it is the latest

2.0.2.2.8
0
 
Bob LearnedCommented:
What kind of application are you testing?  Where are you at with the 2.0 process?  There are literally hundreds of reasons for this, and there isn't enough information there to help.

Bob
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
dave4dlAuthor Commented:
Bob,

Thanks for taking the time to respond to my question.

Doesn't the fact that my app compiles and runs just fine in VS.NET 2005 (but fails when run through the NUnit GUI) narrow down the potential causes from hundreds to less?

What are a couple of the potential problems that could be causing this error (under the conditions i described in my question)?

What other information would be helpful in finding the cause?

Thank you,

-David
0
 
Bob LearnedCommented:
David,
I don't have a specific answer to what could be causing this error, but I am willing to take the time to help determine it.  It will take patience and persistence, which I have plenty of.  

1) Did you define a separate project for your NUnit tests, or are they inline with the assembly that you are testing?

2) Can you give me some information, such as code snippets, to highlight where the exception is coming from?

Bob
0
 
dave4dlAuthor Commented:
Thanks Bob,

I really appreciate your help.

The tests are defined inline (in the applicaiton assembly) in a class called "Tests".

I actually dont have the code in front of my right now (i will later this evening) but the line that is throwing the error is in my test class.  
   - Before this erroring line i create an instance of my one and only application class.  
   - On the line throwing the error i call a function from this new object (that is defined in my application class) that relies on the parser library(which i added as a reference to the project).
   - When i take out the reference to the parser library objects (in my code, not in the project) the problem in NUnit goes away

I'll post some code snippets when i have access to them if that would still be helpful.
0
 
Bob LearnedCommented:
>>When i take out the reference to the parser library objects (in my code, not in the project) the problem in NUnit goes away
I am guessing that this doesn't help, because you need those references, right?

Bob

0
 
dave4dlAuthor Commented:
Yeah, I could do without the pre built functionality of that Parserlibrary (i could recode all it's functionality into my app) but i would rather figure out what is going on with the error.  I suppose that since the answer doesn't seem to be on the tip of your tongue (and since you are the only respondent) that this is something that isnt very common.

Let me know if you think of anything.  If nothing comes to mind after a little while, I'll accept one of your comments to close the question.
0
 
Bob LearnedCommented:
Well, let me say that I haven't seen this exception before, so the possibilities are endless.  NUnit uses reflection to get information about an assembly, and it sounds like it is getting confused somewhere.  There is source code available for NUnit (since it is open source), if you are courageous enough to try use that to figure out a solution.

Bob
0
 
dave4dlAuthor Commented:
Thats a good point, i kind of forgot about just looking at the source code.
0
 
Bob LearnedCommented:
Any success?

Bob
0
 
dave4dlAuthor Commented:
Bob,

Sorry I haven't had time to really delve into the source code to track down this error (in the last few weeks).

I appreciate your help on this and I think the answer will become apparent when i take the time to step through the source code (for NUnit).

Sorry I am not able to post a definite cause of my issue but I dont think i will have the time to work on this projects for 6 or 7 weeks.
0
 
dave4dlAuthor Commented:
Oh yeah, I also wanted to say that the way i got around this while i was looking for a solution was to include the parser source code (which i had written earlier) in my current project (so i did not have to include the parser dll)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now