Solved

NUnit failing to load file

Posted on 2006-07-11
14
538 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

789 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