views:

42

answers:

2

Working on an ASP.NET Project (not Web Site) and trying to Start without Debugging from Visual Studio.

First this:

alt text

Then this:

alt text

Once completely reinstalled Microsoft Visual Studio 2008 and it was fixed... for a while.

Looking for any information I can find, including:

  1. What in the Hell is going on?
  2. What way is there to fix it other than completely reinstalling VS2008?
  3. How can it just be fixed permanently?
+3  A: 

Try this - shouldn't take more than a minute or two.

Create a brand-spanking-new, empty Web Application Project. Enter something like "hello world" on the default.aspx page. Run it.

If your problem disappears, you've got something (3rd party DLL, etc) referenced in your project causing the issue.

Else, your looking at an OS, IDE or other environmental issue. I've had some odd VS issues in the past on Win7 that were solved by available updates. I still have to run VS as an administrator to use the "attach to process" for debugging.

update

So, the new project works, which tells us that the problem is somewhere in your old project. This is where the fun part starts, which is what I like to call "binary search debugging." It's crude, a pain in the ass, and if your app is pretty complex, sorting out dependencies can be a pain in the ass.

Create a new project and add all of your source to it.

Build, run. Did it work?

No? Remove half of the source.

Build. run. Did it work?

If so, the problem is in the half that you removed.

Else, it's in the half that remains.

Now, I know this is an incredibly naive approach to debugging, and its very brute-force, and some app configurations can make this damn near impossible, but at least its straightforward.

David Lively
Check this out: I created a new Web Application Project and it worked. So then, I removed every third party DLL and massaged the code to deal with them missing. It still doesn't work. =(
Daniel Henry
Actually, once I restarted AFTER having pulled out those DLL's... NOW it works.
Daniel Henry
Glad to hear it. Now comes the fun part of adding them back in until it breaks again. If you're using a rewrite engine or any custom HTTP modules or handlers, they might be a good place to start looking.
David Lively
Oh wait. False alarm. It's broken again. Now I have no idea what to do.
Daniel Henry
I haven't even added those other components back in again. Tried rebooting multiple times. No dice.
Daniel Henry
Go back to your test case (blank web app) and make sure its still working. If so, start adding your source into that project until it breaks.
David Lively
Actually, I figured out that it pumps an error into the event log every time it crashes. I couldn't find the exception but I could find what threw it. System.Net.Sockets.Socket. Based on that, I tried manually setting the port number again, and then it worked. Last time that wasn't the problem, but the lesson of the day for me is to look at the Event Log lol
Daniel Henry
How bizarre. Thanks for posting the fix.
David Lively
A: 

Any other service listening to the port number you're using? Try changing the port number or use IIS instead of running it on cassini.

Paulus E Kurniawan
If another application is listening on the same port, the server will not start, and VS will give you a meaningful error message.
David Lively