Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 randomly unable to debug WCF service

I'm running Visual Studio 2010 on a Windows 7 x64 machine, and occasionally VS is giving me the good old "The remote procedure could not be debugged.This usually indicates that debugging has not been enabled on the server" error that a lot of people ask about.

My problem, though, is that it seems to only do this randomly(it can be anywhere from a few minutes to a few hours), and after I've made plenty of successful calls to the service already. It doesn't prevent the service from working. It still returns values and doesn't throw any errors. The only difference is that annoying dialog pops up everytime I start to debug my application.

I should mention that I'm connecting the WCF service from a WPF application. If I launch the web site the service is part of, I don't get the dialog.

A few of the things I've tried that do not work:

  • Killing and restarting the server.
  • Compiling the web server in x86
  • Enabling tracing, but couldn't find any problems.

Is this just a bug in Visual Studio 2010, or is there something I'm missing?

UPDATE

I've noticed that this seems to occur if my WPF application crashes while the WCF service is being initialized. Afterwards, all attempts to call the WCF service will bring up the "Unable to debug" message until I restart VS2010.

like image 270
rossisdead Avatar asked Jun 02 '10 21:06

rossisdead


1 Answers

This might not necessarily be an option if you've already deployed the service, but if you add the website as a local project rather than as an IIS project, it'll use the built-in debug web server (Cassini), which VS seems to have less trouble attaching to.

like image 141
Rei Miyasaka Avatar answered Oct 13 '22 01:10

Rei Miyasaka