Re: Setting up Nunit in external tools in VS2005

"Charlie Poole" <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <011401c89b3c$2e696020$6401a8c0@ferrari>
Hi David, 

> Apologies if this has been covered before, but I couldn't 
> find it in the mailing list archives or with Google.
> 
> I have set Nunit (2.4.7) up in the VS2005 (pro, sp1) external 
> tools menu using the full path to nunit.exe, "$(TargetPath)" 
> and "$(TargetDir)", as described in the docs. However, when I 
> run it on my unit test project (a class library DLL) I get an 
> "Assembly not loaded" exception for "nunit.framework". If I 
> look at the project configuration in Nunit then the project 
> path seems to have the intermediate directory 
> ("...\obj\Release\..." instead of "...\bin\Release\...").

VS2005 changed the meaning of TargetPath, etc. from the bin
to the obj directories. It's annoying.

When you say "docs" do you mean the NUnit docs? I'd like to
change anything that is misleading there.

> The way I got around it was to load the csproj file from the 
> command line using "$(ProjectDir)$(ProjectFileName)" for the 
> arguments.

Good workaround.
 
> My questions are these:
> 
> 1) Has anyone else had the same experience with target path 
> being wrong?

Yup. Most everyone who switches from VS2003 to VS2005. 

> Is this a VS2005 bug or could I be doing something wrong to 
> launch Nunit?

The VS folks think it's a feature. :-)
 
> 2) Are there any drawbacks to using the csproj rather than 
> the compiled assembly? I assume I will need to include all my 
> unit tests in this project.

No disadavantages, but you need to change the name of any test
config file from something.dll.config to something.config and
put it in the same directory as the csproj file.

You can still have multiple test assemblies if you like. Either
run each separately or create a .nunit project file that includes
all of them. The same config file change applies.

Charlie

> Thanks.
> --
> David McMinn, MaxWell Downhole Technology Ltd Discovery 
> Drive, Arnhall Business Park, Westhill, Aberdeen, AB32 6FG
> Tel:    +44 (0)1224 748320              Fax: +44 (0)1224 748330
> Direct: +44 (0)1224 748324
> 
> --------------------------------------------------------------
> -----------
> This SF.net email is sponsored by the 2008 JavaOne(SM) 
> Conference Don't miss this year's exciting event. There's 
> still time to save $100. 
> Use priority code J8TL2D2. 
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java
> .sun.com/javaone
> _______________________________________________
> Nunit-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nunit-users
> 



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.