views:

3447

answers:

5

When trying to execute from within Visual Studio 2008 your application and you get the (uninformative) message "The operation could not be completed".

The solution to this is to turn off the "Visual Studio Hosting Process".

The problem with turning off this "hosting process" is that all the "run and rewrite" functionality is no longer available. OK, so this isn't a big deal, but I'm always getting this message no matter what machine I use (and it might be nice once in a while to use the rewrite and execute functionality).

Am I doing something wrong? How come this "feature" within VS seems to complain so readily? Do other people have success with enabling the hosting process and making use of it?

A: 

I honestly have never seen this message and I work with Visual Studio for at least 8 hours a day. Is this reproducible on other machines? If so is there anything weird or abnormal in your code that could cause this to crash?

Nick Berardi
A: 

I use 4 different machines and have got this situation on all of them. I understand what is causing the problem - it is that the VS hosting process isn't terminating after the first debug session ends, which means that the next time that you try to compile the exe the hosting process is locking the exe and preventing compilation. Another solution therefore is to use Task Manager to kill the VS hosting process and compile and debug as normal but thats even more of a hassle!

I can't think that its anything in my code that would be causing this - its probably a VS issue itself isn't it?

Calanus
A: 

Is your project output folder set to a network share?

If so, try changing it to a local folder and see what happens. It appears that VS is not always able to terminate the process if the host exe is running from a share.

The other possibility is that the project is open and running in debug mode on another instance of Visual Studio - although I suspect you will allready have ensured this is not the case.

Martin
+1  A: 

The problem with turning off this "hosting process" is that all the "run and rewrite" functionality is no longer available.

The Visual Studio Hosting Process is not needed to allow Edit and Continue. It is used for "Design time expression Evalutation" in the case where the project is a dll rather than an EXE. It is also used to provide debugging for partial trust scenarios. See the documentation for everything it does.

It is highly unlikely it does anything you need, so don't feel bad turning it off.

Steve Steiner
A: 

Here's the anwser: disable "Enable he Visual Studio hosting process" in he debug tab of your projects properties.

I found it here: http://social.msdn.microsoft.com/Forums/en-US/vbide/thread/40d2d241-a0c0-4137-9da9-e40611972c0e/