Last post Nov 05, 2009 05:53 PM by thuhue
May 06, 2009 08:17 PM|toddwseattle|LINK
I'm doing a project in ASP.NET and doing things on the ASP.NET development server in Visual Studio 2008. I can run and debug "hello world" website well using the asp.net development server. However, I want to use NUnit on my C# assemblies for unit testing.
When I build and deploy the asp.net application, I can't figure out for the asp.net development server where the .dll or .exe generated by the website build process is placed in the filesystem with the defaults for debug. Apparently for example, it says
the development server is using \Visual Studio 2008\WebSite1\ as the local path; but there does not seem to be a .dll or .exe generated under that path--the only things in [bin] are the assemblies for NUnit that I put there, and the source files is the only
thing in the [app code] direcdotry. If i deploy to my hosting provider, i see their are dll's generated.
Does the Development Server generate DLL's? anyone know a work around for unit testing with NUnit on my C# code locally with the development server? Does the development server just interperet the files and not have a dll? I can't find a description with
any technical details of how the process is different deploy to iis vs. the development server itself.
I generated a work around that involves basically making a local "class" project in the site; but its super clumsy so there should be a better way. thanks!
asp.net development server
.net 3.5 sp1
Nov 05, 2009 01:16 PM|thuhue|LINK
Have you found a solution?
Nov 05, 2009 05:16 PM|toddwseattle|LINK
Have you found a solution?
I did indeed find a solution, sort of. the issue is that in debug mode asp runs things in sort of a contained enviornment; and using any of the test frameworks tends to be difficult. there are a couple of projects that were started as extensions to nunit;
that basically emulate the server harness(see
http://nunitasp.sourceforge.net/); but none of them is currently active.
After some correspondence with some friends on the visual studio team, i switched to have my class use the unit test framework in VS 2008; this works better, except that by default for ASP all of the methods are marked private, and then need accessor methods
(which the framework does an ok job generating). This however was very hit or miss. the only way was essentially to seperate out "model" classes and make a test harness project that uses them and then generate the test. that works with nunit or with
the vs 2008 test framework. neither is optimal; and especially given what is happening in things like the ruby on rails world--where the test cases are autogenerated by the framework--I'm hopeful the ms folks will look at something better for the future (though
I fear none of this is addressed in vs 2010).
Nov 05, 2009 05:53 PM|thuhue|LINK
Base on what you said, is the ruby on rails world brighter?