Solved

NUnit failing to load file

Posted on 2006-07-11
14
508 Views
Last Modified: 2012-05-05
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
Comment
Question by:dave4dl
  • 7
  • 6
14 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17086421
Which version of NUnit are you using?

Bob
0
 
LVL 15

Author Comment

by:dave4dl
ID: 17087915
I just downloaded it today so i assume it is the latest

2.0.2.2.8
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17089930
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
 
LVL 15

Author Comment

by:dave4dl
ID: 17094089
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
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17094140
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
 
LVL 15

Author Comment

by:dave4dl
ID: 17094352
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 96

Expert Comment

by:Bob Learned
ID: 17094500
>>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
 
LVL 15

Author Comment

by:dave4dl
ID: 17106103
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
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 17107622
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
 
LVL 15

Author Comment

by:dave4dl
ID: 17109039
Thats a good point, i kind of forgot about just looking at the source code.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17129361
Any success?

Bob
0
 
LVL 15

Author Comment

by:dave4dl
ID: 17284506
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
 
LVL 15

Author Comment

by:dave4dl
ID: 17284534
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now