VS2005 Web Project - No DLL for Nunit

S

Steven Nagy

Hi,

Creating a new website and building, there's no DLL. Apparently it
builds it on first request and sticks it in some temp cache somewhere.
That's all fine and dandy, except how do I reference my web project
from my test project if there's no DLL to reference?

I found the Web Application Project Template download from MS so that I
can create traditional VS2003 style projects, and this solves the
problem because I have a DLL.
But MS seems to plug this project template ONLY for converting 2003
projects to 2005.
They make no mention of testing.

So this makes me think that I've missed something?
I'd rather develop my website projects using the default VS2005 web
project rather than the new one I downloaded, because thats how MS
wants me to develop (I'm very impressionable). So how do I get a
seperate test project to test my web project classes?
(WITHOUT having to move those classes into a seperate assembly).

Many thanks in advance,
Steven Nagy
 
B

Ben Voigt

Steven Nagy said:
Hi,

Creating a new website and building, there's no DLL. Apparently it
builds it on first request and sticks it in some temp cache somewhere.
That's all fine and dandy, except how do I reference my web project
from my test project if there's no DLL to reference?

I found the Web Application Project Template download from MS so that I
can create traditional VS2003 style projects, and this solves the
problem because I have a DLL.
But MS seems to plug this project template ONLY for converting 2003
projects to 2005.
They make no mention of testing.

So this makes me think that I've missed something?
I'd rather develop my website projects using the default VS2005 web
project rather than the new one I downloaded, because thats how MS
wants me to develop (I'm very impressionable). So how do I get a
seperate test project to test my web project classes?
(WITHOUT having to move those classes into a seperate assembly).

Can't you use a "reference to project" instead of "reference to DLL"?...
that way it follows the project output, whether it's debug/release, etc.
 
S

Steven Nagy

No it doesn't even see the project under the project references.
And I'm assuming this is because the DLL doesn't exist for the web
project.
Does it work for you in VS2005, new web site?
 
S

Steven Nagy

Ok thats cool, so how do I do testing then?
Its too late once I've published the site.
 
B

Ben Voigt

Steven Nagy said:
No it doesn't even see the project under the project references.
And I'm assuming this is because the DLL doesn't exist for the web
project.
Does it work for you in VS2005, new web site?

Nope, you're right, the web project can't be referenced. Can you explain
your rationale for not putting your testable classes in a reusable assembly?
 
S

Steven Nagy

Nope, you're right, the web project can't be referenced. Can you explain
your rationale for not putting your testable classes in a reusable assembly?

But thats just it... I _am_ putting my test cases in a seperate
assembly.
But this seperate assembly is in a seperate project, so essentially I
have 2 projects:

MySite.Web
MySite.Tests

But I can't reference MySite.Web from within MySite.Tests without
adding a reference.

Unless you ment something different, in which case I'm sorry for
misunderstanding the question.
 
B

Ben Voigt

Steven Nagy said:
But thats just it... I _am_ putting my test cases in a seperate
assembly.
But this seperate assembly is in a seperate project, so essentially I
have 2 projects:

MySite.Web
MySite.Tests

But I can't reference MySite.Web from within MySite.Tests without
adding a reference.

Unless you ment something different, in which case I'm sorry for
misunderstanding the question.

No need to be sorry, but I asked why the testable classes, not the tests,
couldn't go into a new project.

So you'd have something like:

MyLogic
MyLogic.Tests
MySite

where MyLogic is referenced by both MySite and MyLogic.Tests

I know you already said you didn't want that, but I was trying to find out
why, because maybe there's another way to get the behavior you want.
 
S

Steven Nagy

Ah ok I see what you are saying.

Yes there are a number of work arounds, and I have already continued on
with the project with one such work around. I was just more interested
in the design reason for the lack of availability of the assembly for
testing; the 'why' of it all, and if there is a way to do it against
the web site classes, rather than the way you suggested, or resorting
to the web application templates you can download from Microsoft.

Cheers,
SN
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top