2

I have a test project for a solution which involves an MVC web application and several class libraries. I am using mock objects and System.Web.Abstractions to avoid dependencies on ASP.NET intrinsic objects. But when I start my test project Cassini loads. If I immediately stop cassini all my tests still pass. So why does it load? It's not that it's a problem that it's loading. But if I'm doing everything right it seems like it shouldn't load. So what causes it to load when I run my tests?

A lot of changes are being made to the project and I haven't been working on it directly for a few days so I don't know exactly when Cassini started running.

Mark J Miller
  • 4,751
  • 5
  • 44
  • 74

4 Answers4

0

I don't do asp.mvc but seems a common scenario.

It is a wep app, no? Open project properties, select 'web' tab near bottom, select 'Don't open a page...' and UNcheck Debuggers:asp.net.

HTH, Sky

Sky Sanders
  • 36,396
  • 8
  • 69
  • 90
  • I'm no longer working on the project and so I can't verify wither your fix works for my problem, but I'll mark yours as the answer. – Mark J Miller Jan 04 '10 at 19:27
0

I was actually trying to find ways to run cassini as I run my unit test project. I was able to do this by setting up explicit project dependency to the web project.

i.e right click unit test project > project dependencies > tick web project.

For your case it could be undoing this. untick the web project. Hope that helps

ronaldwidha
  • 1,345
  • 2
  • 12
  • 24
0

Ok, so the actual answer to my question is right here: How do you configure VS2008 to only open one webserver in a solution with multiple projects?

Turns out, that you can go to the properties window (select project -> F4) and turn this off by setting "Always Start When Debugging" to "false". Finally, this has always been so annoying and even happens when my test project has absolutely no dependencies on a web project.

Community
  • 1
  • 1
Mark J Miller
  • 4,751
  • 5
  • 44
  • 74
0

It sounds like your tests are touching something outside of System.Web.Abstractions. What classes from the abstractions assembly are you touching? This information would be needed to determine why cassinin is loading.

Sean Chambers
  • 8,572
  • 7
  • 41
  • 55
  • Thank you, but I guess I'm just gonna have to dig in and find out specifically what is causing it to load. I can probably just do some poking around with a test project to see what finally causes it to load. – Mark J Miller Feb 11 '09 at 23:01