visual-studio Visual Studio 托管过程和“操作无法完成”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33338/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio Hosting Process and "The operation could not be completed"
提问by Calanus
When trying to execute from within Visual Studio 2008 your application and you get the (uninformative) message "The operation could not be completed".
当尝试从 Visual Studio 2008 中执行您的应用程序时,您会收到(无信息)消息“无法完成操作”。
The solution to this is to turn off the "Visual Studio Hosting Process".
对此的解决方案是关闭“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 alwaysgetting 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?
难道我做错了什么?为什么 VS 中的这个“功能”似乎很容易抱怨?其他人是否在启用托管流程并使用它方面取得了成功?
回答by Steve Steiner
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 documentationfor everything it does.
允许编辑并继续不需要 Visual Studio 托管进程。在项目是 dll 而不是 EXE 的情况下,它用于“设计时表达式评估”。它还用于为部分信任场景提供调试。有关它所做的一切,请参阅文档。
It is highly unlikely it does anything you need, so don't feel bad turning it off.
它不太可能执行您需要的任何操作,因此请不要为将其关闭而感到难过。
回答by Martin
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.
如果是这样,请尝试将其更改为本地文件夹,看看会发生什么。如果主机 exe 从共享运行,VS 似乎并不总是能够终止进程。
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.
另一种可能性是该项目已打开并在另一个 Visual Studio 实例上以调试模式运行 - 尽管我怀疑您已经确保情况并非如此。
回答by Murat Y?ld?z
There are several causes and workarounds regarding to this problem and you might try the following ones that are useful most of the time:
此问题有多种原因和解决方法,您可以尝试以下大多数情况下有用的方法:
Delete the "Your_Solution_FileName.suo"file and restart Visual Studio.
删除“Your_Solution_FileName.suo”文件并重新启动 Visual Studio。
or
或者
Right click on the project and select Unload Project and then click Reload Project by right clicking on the project again might also fix it.
右键单击项目并选择卸载项目,然后通过再次右键单击项目来单击重新加载项目也可能会修复它。
Hope this helps...
希望这可以帮助...
回答by Nick Berardi
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?
老实说,我从未见过这条消息,而且我每天至少使用 Visual Studio 工作 8 小时。这在其他机器上可以重现吗?如果是这样,您的代码中是否有任何可能导致崩溃的奇怪或异常之处?
回答by Calanus
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!
我使用了 4 台不同的机器,并且在所有机器上都遇到了这种情况。我了解导致问题的原因 - 第一个调试会话结束后 VS 托管进程没有终止,这意味着下次您尝试编译 exe 时,托管进程会锁定 exe 并阻止编译。因此,另一个解决方案是使用任务管理器来终止 VS 托管进程并正常编译和调试,但这更麻烦!
I can't think that its anything in my code that would be causing this - its probably a VS issue itself isn't it?
我无法认为我的代码中的任何内容都会导致这种情况 - 它本身可能是 VS 问题,不是吗?
回答by Calanus
Here's the anwser: disable "Enable he Visual Studio hosting process" in he debug tab of your projects properties.
这是答案:在项目属性的调试选项卡中禁用“启用 Visual Studio 托管进程”。
I found it here: http://social.msdn.microsoft.com/Forums/en-US/vbide/thread/40d2d241-a0c0-4137-9da9-e40611972c0e/
我在这里找到它:http: //social.msdn.microsoft.com/Forums/en-US/vbide/thread/40d2d241-a0c0-4137-9da9-e40611972c0e/
回答by Mark
Probably your web hosting already turn of the network function, you can open a ticket to contact with your web host to confirm, or anything you did would be useless.
可能你的虚拟主机已经开启了网络功能,你可以开工单联系你的虚拟主机确认,否则你所做的任何事情都是无用的。
Some visual studio hostingcan be found at here.
一些视觉工作室托管可以在这里找到。
Good luck,
祝你好运,
Mark
标记

