我遇到了同样的问题,直到我取消选中项目属性中的“调试”选项卡下的“启用 Visual Studio 托管进程”后,所有技巧都无法解决问题
I had the same problem and all the tricks didnt do it until I unchecked the "Enable the Visual Studio hosting process" under the debug tab in the project properties
然后我注意到我无法手动删除我的 Bin 目录,并且我意识到 MyApp.vshost.exe 一直在后台运行,防止自身被 Visual Studio 2012 覆盖。不知道它仍然如何工作VS2010虽然:/
总之,对我有用的解决方案:杀死进程,再试一次。
换句话说,您是否尝试过将其关闭然后再次打开?
Ugh! I was experiencing the exact same symptoms you were, and after trying all the suggestions, the only one that worked was your own: creating a new project and copying all the contents across.
Then I noticed that I couldn't manually delete my Bin directory, and I realised that MyApp.vshost.exe had been running in the background this whole time, preventing itself from being overwritten by Visual Studio 2012. Not sure how it still worked from VS2010 though :/
In summary, the solution that worked for me: Kill the process, try again.
In other words, have you tried turning it off and on again?
很抱歉提出一个老问题,但我今天遇到了同样的问题,但原因实际上是因为解决方案的构建顺序。 如果您进入解决方案属性页 -> 通用属性 -> 启动项目。 确保选中多个启动项目,将 Web 项目移动到列表顶部。
在我的 Web 应用程序解决方案中,我有 2 个 Web 项目和 5 个代码项目,其中一个代码项目位于顶部,因此调试无法启动。
希望其他人觉得这有帮助
Sorry to bring up an old question but I had the same problem today, but the reason was actually because of the build order of the solution. If you go into the Solution Property Pages -> Common Properties -> Startup Project. The ensuring Multiple startup projects is selected, move the web project to the top of the list.
In my web application solution I have 2 web projects and 5 code projects, one of my code projects was at the top, and as such debug would not start.
This solution has already been mentioned but it took some tinkering to make it work so here is a clear solution
On the Project menu/tab, click Properties. (or on your solution explorer)
Click the Debug tab.
Clear the Enable the Visual Studio hosting process check box.(uncheck it)
Check if it works.
If it does not restart your computer (some of the projects files run in the background if you know how to stop them then restarting is not necessary just end their tasks) rebuild the project
First, in your project properties and in the Debug tab, make sure that your Start Action is set to Start Project and not some other option that won't run. If that doesn't resolve it then:
Go to Tools -> Options -> Environment -> Keyboard and in Show commands containing: type Debug.Start and make sure that Shortcuts for selected command: is set to F5 (Global). Also make sure you do not have anything else mapped to F5 that might conflict.
Finally if this doesn't resolve your issue, then I suggest that you export your current environment settings as a backup, and then reset all environment settings completely. See if that resolves it, if it does not then reimport your old settings and try repairing visual studio.
I am using VS2013 and my debugger suddenly stopped working. I kept getting a message box stating debugging is not supported.
I finally fixed it by clearing NATIVE checkbox under Debuggers in the Property Pages->Start Options tab for the start up project. I now only have ASP.NET selected under Debuggers.
转到解决方案资源管理器,右键单击您的项目转到属性,单击“调试”,底部有一个复选框,单击该复选框以启用 SQL Server 调试。
Go to Solution Explorer, right-click your project go to properties, click Debug, at the bottom there is a check box, click the check box to Enable SQL Server Debugging.
Verify that in your Project -> Properties -> Debug tab -> Start Action sections that "Do not launch, but debug my code when it starts" is not checked. Somehow this got checked months after I created and had been working on my project.
I faced this problem. In my case, somehow the startup project entry got cleared. So, make sure atleast one among the projects in your solution explorer is set as the startup project. To set up a startup project, right click on the desired project in the solution explorer --> click "Set as Startup Project"
I finally created other project and copied existing files and folders to it. Maybe 'unprofessional' but it's working :) Fortunately this is small project
I'm experiencing the same problem. I haven't been able to display the debug window, but I was able to redirect the debug output to the simplified 'immediate window' by checking the corresponding option in Debug->Options and Settings; only shows explicit Debug writes in the code like Debug.Writeline().
I had the same issue and while looking at bresleveloper's answer, I found the following issue which seemed to work for me. Posting this in case anyone else has the same issue, then they can check this as well.
Went to Debug Tab < Project Properties. Found that Debugging options were totally disabled. Checked the "Enable Debugging" check box. That did if for me..
我的桌面应用程序也有同样的问题 这个论坛说你应该将你的项目标记为启动项目,因为 Visual Studio 尚未标记。
它对我来说效果很好,我相信它会帮助其他可能遇到这个问题的人。
I had the same problem with my desktop application and as this forum says you should mark your project as a startup project, since visual studio has unmarked.
It worked just fine for me and I believe it will help other people that may have this problem.
我禁用了托管进程,以解决它保持运行并保持文件锁定的问题。当我这样做时,我发现当我按 F5 进行调试时,我的控制台窗口不再出现,尽管我的程序运行良好。 然后我注意到我勾选了“首选 32 位”复选框。我取消选中此选项,重新构建,控制台窗口再次出现。这看起来很奇怪,所以我再次勾选它并确认我可以重现这种行为。 我正在使用 Visual Studio 2013。
With regard to the problem above where the Console doesn't appear. (I don't have enough merit points to comment directly against that post.)
I disabled the hosting process in order to get around the problem of it being left running and leaving the files locked. When I did this I found my Console window no longer appeared when I hit F5 to debug, although my program ran fine. I then noticed that I had the "Prefer 32-bit" check-box ticked. I unticked this, rebuilt and the Console window appeared once more. This seemed strange so I ticked it off again and confirmed I can reproduce this behaviour. I'm using Visual Studio 2013.
根据我使用 Visual Studio 2015 的经验,我尝试删除所有进程并重新启动它,但没有成功。我尝试删除bin目录,但没有成功。
遗憾的是,唯一有效的方法是在管理模式下关闭并重新启动 Visual Studio 2015。叹...
My experience with Visual Studio 2015, I tried deleting all processes and restarting it didn't work. I tried deleting the bin directory, it didn't work.
Sadly, the only thing that worked was closing down and restarting Visual Studio 2015 in Admin mode. Sigh...
I was having the same issue (apparently several years later) where I could see my device in VS 2015, but when I wanted to debug on the device, nothing happened.
It may be a different issue than the one the original poster had, but this solution fixed the problem for me in VS 2015.
Right-click the solution and select Properties, and then notice if the checkbox for your solution in the Deploy column is checked, if it is not, then check it and try debugging again. Worked for me.
这是因为我更改了 App 类的命名空间,但没有更新 App.xaml 中的 Class 属性以匹配新的命名空间。我更改了 xaml 文件中的命名空间,它再次工作。
I had this problem in a WPF application I was working on. When running the debugger, a process named MyApp.VsHost.exe would start and continue running in the background, but there would be no exceptions thrown and nothing in the Output window except build information.
It was because I had changed the namespace of my App class but did not update the Class attribute in App.xaml to match the new namespace. I changed the namespace in the xaml file and it worked again.
如果您在同一文件夹中有单独的应用程序或 SSIS 项目,则您的 Visual Studio 可能正在构建该项目而不是您想要运行的项目。
希望这有帮助!
If you are working with an SSIS package or a solution with more than one application inside of it. Make sure you have the correct application set as your "Start up project".
If you have a separate application or SSIS project in the same folder, your Visual Studio is probably building that instead of what you want to run.
对我有用的是完全删除解决方案文件夹(必须重新启动 Windows 才能执行此操作),然后从源代码管理中将其恢复。听起来很激烈——但实际上并不需要很长时间。
What worked for me was completely deleting the solution folder (had to reboot Windows to be allowed to do this), and then getting it back from source control. Sounds drastic - but it doesn't actually take very long.
发布评论
评论(30)
我遇到了同样的问题,直到我取消选中项目属性中的“调试”选项卡下的“启用 Visual Studio 托管进程”后,所有技巧都无法解决问题
I had the same problem and all the tricks didnt do it until I unchecked the "Enable the Visual Studio hosting process" under the debug tab in the project properties
啊!我遇到了与您完全相同的症状,在尝试了所有建议后,唯一有效的是您自己的建议:创建一个新项目并复制所有内容。
然后我注意到我无法手动删除我的 Bin 目录,并且我意识到 MyApp.vshost.exe 一直在后台运行,防止自身被 Visual Studio 2012 覆盖。不知道它仍然如何工作VS2010虽然:/
总之,对我有用的解决方案:杀死进程,再试一次。
换句话说,您是否尝试过将其关闭然后再次打开?
Ugh! I was experiencing the exact same symptoms you were, and after trying all the suggestions, the only one that worked was your own: creating a new project and copying all the contents across.
Then I noticed that I couldn't manually delete my Bin directory, and I realised that MyApp.vshost.exe had been running in the background this whole time, preventing itself from being overwritten by Visual Studio 2012. Not sure how it still worked from VS2010 though :/
In summary, the solution that worked for me: Kill the process, try again.
In other words, have you tried turning it off and on again?
重启VS并尝试调试。有时会发生这种情况,甚至我也遇到了同样的问题。
Restart VS and try to debug. Some time it happens, even I also had the same problem.
很抱歉提出一个老问题,但我今天遇到了同样的问题,但原因实际上是因为解决方案的构建顺序。
如果您进入
解决方案属性页
->通用属性
->启动项目
。确保选中
多个启动项目
,将 Web 项目移动到列表顶部。在我的 Web 应用程序解决方案中,我有 2 个 Web 项目和 5 个代码项目,其中一个代码项目位于顶部,因此调试无法启动。
希望其他人觉得这有帮助
Sorry to bring up an old question but I had the same problem today, but the reason was actually because of the build order of the solution.
If you go into the
Solution Property Pages
->Common Properties
->Startup Project
.The ensuring
Multiple startup projects
is selected, move the web project to the top of the list.In my web application solution I have 2 web projects and 5 code projects, one of my code projects was at the top, and as such debug would not start.
Hope others find this helpful
已经提到了此解决方案,但需要进行一些修补才能使其工作,因此这里是一个明确的解决方案
如果它没有重新启动您的计算机(某些项目文件在后台运行,如果您知道如何停止它们,则无需重新启动,只需结束其任务即可)
重建项目
这应该可以解决问题
This solution has already been mentioned but it took some tinkering to make it work so here is a clear solution
If it does not restart your computer (some of the projects files run in the background if you know how to stop them then restarting is not necessary just end their tasks)
rebuild the project
this should solve the problem
在你进行激烈的修复之前......试试这个!
只需启动调试文件夹中的 .exe 文件即可。 “不要关闭它!”
在 Visual Studio 中启动调试器。
(i) 应弹出错误...只需说“否”
关闭您在步骤“1”中启动的“.exe”文件。
再试一次。
由于某种原因,视觉工作室被困在我正在构建的这个应用程序上,但这对我有用。
Before you go through an intense fix... try this!!!
Simply start the .exe file in your debug folder. "Do not close it!"
Start the debugger in Visual Studio.
(i) An error should pop up... just say "no"
Close the ".exe" file you started in step "1."
Try again.
For some reason, visual studio was stuck on this app that i was building but this worked for me.
是什么帮助我解决了这个问题:
What helped me out of this issue:
首先,在项目属性和
调试
选项卡中,确保将启动操作
设置为启动项目
,而不是其他选项不会运行。如果这不能解决问题,那么:转到
Tools ->选项->环境->键盘
并在显示命令包含:
中键入Debug.Start
并确保所选命令的快捷方式:
设置为F5(全局)
。另请确保没有任何其他内容映射到 F5 可能会发生冲突。最后,如果这不能解决您的问题,那么我建议您导出当前的环境设置作为备份,然后完全重置所有环境设置。看看是否可以解决问题,如果没有解决,则重新导入旧设置并尝试修复 Visual Studio。
First, in your project properties and in the
Debug
tab, make sure that yourStart Action
is set toStart Project
and not some other option that won't run. If that doesn't resolve it then:Go to
Tools -> Options -> Environment -> Keyboard
and inShow commands containing:
typeDebug.Start
and make sure thatShortcuts for selected command:
is set toF5 (Global)
. Also make sure you do not have anything else mapped to F5 that might conflict.Finally if this doesn't resolve your issue, then I suggest that you export your current environment settings as a backup, and then reset all environment settings completely. See if that resolves it, if it does not then reimport your old settings and try repairing visual studio.
关闭您的项目,然后删除 yourproject\bin\Debug\ 文件夹中的所有文件以创建新的调试解决方案
close your project then delete all files on yourproject\bin\Debug\ folder to make new debug solution
可能对某人有帮助的快速修复:
我正在使用 VS2013,我的调试器突然停止工作。
我不断收到一个消息框,指出不支持调试。
我最终通过在启动项目的“属性页”->“启动选项”选项卡中清除“调试器”下的“NATIVE”复选框修复了该问题。我现在只在调试器下选择了 ASP.NET。
Quick fix that might help someone:
I am using VS2013 and my debugger suddenly stopped working.
I kept getting a message box stating debugging is not supported.
I finally fixed it by clearing NATIVE checkbox under Debuggers in the Property Pages->Start Options tab for the start up project. I now only have ASP.NET selected under Debuggers.
我有一个非常有趣的解决方案,但它对我有用,
按住 F5 键直到看到调试开始,我是认真的。
I have very funny solution, but it worked for me,
Hold the F5 key until you see that the debugging started, I'm serious guys.
转到解决方案资源管理器,右键单击您的项目转到属性,单击“调试”,底部有一个复选框,单击该复选框以启用 SQL Server 调试。
Go to Solution Explorer, right-click your project go to properties, click Debug, at the bottom there is a check box, click the check box to Enable SQL Server Debugging.
验证您的项目 ->属性->调试选项卡 ->未选中“不启动,但在启动时调试我的代码”的启动操作部分。不知何故,在我创建并开始我的项目几个月后,这个问题得到了检查。
取消选中此选项解决了我的问题。
Verify that in your Project -> Properties -> Debug tab -> Start Action sections that "Do not launch, but debug my code when it starts" is not checked. Somehow this got checked months after I created and had been working on my project.
Unchecking this solved my problem.
我遇到了这个问题。就我而言,不知怎的,启动项目条目被清除了。因此,请确保解决方案资源管理器中至少有一个项目被设置为启动项目。要设置启动项目,请在解决方案资源管理器中右键单击所需的项目 -->单击“设置为启动项目”
I faced this problem. In my case, somehow the startup project entry got cleared. So, make sure atleast one among the projects in your solution explorer is set as the startup project. To set up a startup project, right click on the desired project in the solution explorer --> click "Set as Startup Project"
我最终创建了其他项目并将现有文件和文件夹复制到其中。也许“不专业”,但它正在工作:)幸运的是,这是一个小项目
I finally created other project and copied existing files and folders to it. Maybe 'unprofessional' but it's working :) Fortunately this is small project
我遇到了同样的问题。我无法显示调试窗口,但通过检查“调试”->“选项和设置”中的相应选项,我能够将调试输出重定向到简化的“立即窗口”;仅显示代码中的显式调试写入,例如 Debug.Writeline()。
视觉工作室2010
I'm experiencing the same problem. I haven't been able to display the debug window, but I was able to redirect the debug output to the simplified 'immediate window' by checking the corresponding option in Debug->Options and Settings; only shows explicit Debug writes in the code like Debug.Writeline().
Visual Studio 2010
这个过程通常对我有用:
任何剩余的“孤立”实例。
This process generally works for me:
any remaining 'orphan' instances.
我找到了一个解决方案:
.csproj
项目头。
部分中搜索false
将I have found a solution:
.csproj
project header with notepad ++ for example.<UseIISExpress>false</UseIISExpress>
in the<PropertyGroup>
section<UseIISExpress>true</UseIISExpress>
我找到了一个解决方案:
I have found a solution:
我遇到了同样的问题,在查看 bresleveloper 的答案时,我发现以下问题似乎对我有用。发布此内容以防其他人遇到相同的问题,然后他们也可以检查此问题。
转到“调试”选项卡<项目属性。发现调试选项完全被禁用。选中“启用调试”复选框。如果对我来说就是这样..
I had the same issue and while looking at bresleveloper's answer, I found the following issue which seemed to work for me. Posting this in case anyone else has the same issue, then they can check this as well.
Went to Debug Tab < Project Properties. Found that Debugging options were totally disabled. Checked the "Enable Debugging" check box. That did if for me..
检查配置管理器,确保所有项目都针对同一平台进行编译。
Check Configuration Manager, make sure all projects are compiling for the same platform.
我的桌面应用程序也有同样的问题 这个论坛说你应该将你的项目标记为启动项目,因为 Visual Studio 尚未标记。
它对我来说效果很好,我相信它会帮助其他可能遇到这个问题的人。
I had the same problem with my desktop application and as this forum says you should mark your project as a startup project, since visual studio has unmarked.
It worked just fine for me and I believe it will help other people that may have this problem.
关于上述控制台不出现的问题。 (我没有足够的优点来直接评论该帖子。)
我禁用了托管进程,以解决它保持运行并保持文件锁定的问题。当我这样做时,我发现当我按 F5 进行调试时,我的控制台窗口不再出现,尽管我的程序运行良好。
然后我注意到我勾选了“首选 32 位”复选框。我取消选中此选项,重新构建,控制台窗口再次出现。这看起来很奇怪,所以我再次勾选它并确认我可以重现这种行为。
我正在使用 Visual Studio 2013。
With regard to the problem above where the Console doesn't appear. (I don't have enough merit points to comment directly against that post.)
I disabled the hosting process in order to get around the problem of it being left running and leaving the files locked. When I did this I found my Console window no longer appeared when I hit F5 to debug, although my program ran fine.
I then noticed that I had the "Prefer 32-bit" check-box ticked. I unticked this, rebuilt and the Console window appeared once more. This seemed strange so I ticked it off again and confirmed I can reproduce this behaviour.
I'm using Visual Studio 2013.
对于新的 ASP.Net Core 1 应用程序。
在包管理控制台下,我运行了
并且我的解决方案可以编译。
For the new ASP.Net Core 1 app.
Under package management console, i ran
and my solution could compile.
根据我使用 Visual Studio 2015 的经验,我尝试删除所有进程并重新启动它,但没有成功。我尝试删除bin目录,但没有成功。
遗憾的是,唯一有效的方法是在管理模式下关闭并重新启动 Visual Studio 2015。叹...
My experience with Visual Studio 2015, I tried deleting all processes and restarting it didn't work. I tried deleting the bin directory, it didn't work.
Sadly, the only thing that worked was closing down and restarting Visual Studio 2015 in Admin mode. Sigh...
同样的错误,尝试以管理员身份执行 VS,它成功了。
Same error, tried executing VS as Administrator and it worked.
我遇到了同样的问题(显然是几年后),我可以在 VS 2015 中看到我的设备,但是当我想在设备上调试时,什么也没发生。
这可能是与原始发帖人遇到的问题不同的问题,但此解决方案在 VS 2015 中为我解决了问题。
右键单击该解决方案并选择“属性”,然后注意“部署”列中解决方案的复选框是否已选中,如果不是,则检查并再次尝试调试。为我工作。
I was having the same issue (apparently several years later) where I could see my device in VS 2015, but when I wanted to debug on the device, nothing happened.
It may be a different issue than the one the original poster had, but this solution fixed the problem for me in VS 2015.
Right-click the solution and select Properties, and then notice if the checkbox for your solution in the Deploy column is checked, if it is not, then check it and try debugging again. Worked for me.
我在我正在开发的 WPF 应用程序中遇到了这个问题。运行调试器时,名为 MyApp.VsHost.exe 的进程将启动并继续在后台运行,但不会引发任何异常,并且除了构建信息之外,输出窗口中不会显示任何内容。
这是因为我更改了
App
类的命名空间,但没有更新App.xaml
中的Class
属性以匹配新的命名空间。我更改了 xaml 文件中的命名空间,它再次工作。I had this problem in a WPF application I was working on. When running the debugger, a process named MyApp.VsHost.exe would start and continue running in the background, but there would be no exceptions thrown and nothing in the Output window except build information.
It was because I had changed the namespace of my
App
class but did not update theClass
attribute inApp.xaml
to match the new namespace. I changed the namespace in the xaml file and it worked again.如果您正在使用 SSIS 包或其中包含多个应用程序的解决方案。确保您将正确的应用程序设置为“启动项目”。
如果您在同一文件夹中有单独的应用程序或 SSIS 项目,则您的 Visual Studio 可能正在构建该项目而不是您想要运行的项目。
希望这有帮助!
If you are working with an SSIS package or a solution with more than one application inside of it. Make sure you have the correct application set as your "Start up project".
If you have a separate application or SSIS project in the same folder, your Visual Studio is probably building that instead of what you want to run.
Hope this helps!
对我有用的是完全删除解决方案文件夹(必须重新启动 Windows 才能执行此操作),然后从源代码管理中将其恢复。听起来很激烈——但实际上并不需要很长时间。
What worked for me was completely deleting the solution folder (had to reboot Windows to be allowed to do this), and then getting it back from source control. Sounds drastic - but it doesn't actually take very long.