Microsoft Visual Studio 2012无法在c#文件中设置断点 [英] Microsoft Visual Studio 2012 cannot set breakpoint in c# file

查看:260
本文介绍了Microsoft Visual Studio 2012无法在c#文件中设置断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了Microsoft Visual Studio Professional 2012,版本11.0.60610.01更新3.



调试ac#(.cs)文件时Visual Studio给我以下消息当我尝试设置一个断点:


断点不能插入到这个位置。


即使尝试将其设置为方法中的一行,我也收到此消息。但是在Visual Basic应用程序的.vb文件中,我可以设置一个断点。



我想知道有没有人有任何建议来解决这个问题,或者如果我需要重新安装视觉工作室



谢谢

解决方案

我终于可以找到一个解决办法。我必须通过控制面板 - >程序和功能,右键单击Microsoft Visual Studio Professional 2012并选择更改在Visual Studio 2012实例上进行修复。然后在Visual Studio窗口中选择修复。



作为修复过程的一部分,我还必须下载位于这里的Web部署: http://www.microsoft.com/en-us/download/details.aspx?id=4148 并指出视觉工作室修复过程到.msi文件,当它说它找不到Web部署包,并无法从互联网下载。



我也不得不实施修复指示在以下stackoverflow问题中: Visual Studio 2012中的普通C#编辑器(无智能感,无缩进,无代码突出显示)



现在我可以按预期调试应用程序。 >

I have Microsoft Visual Studio Professional 2012 installed, version 11.0.60610.01 Update 3.

When debugging a c# (.cs) file Visual Studio gives me the following message when I try to set a breakpoint:

"A breakpoint could not be inserted at this location".

I get this message even when trying to set it on a line within a method. But in a .vb file for a Visual Basic app, I can set a breakpoint.

I am wondering if anyone has any suggestions to resolve this or if I need to reinstall visual studio.

Thanks

解决方案

I was finally able to find a solution for this. I had to do a repair on my Visual Studio 2012 instance through the control panel -> Programs and Features, right clicking on Microsoft Visual Studio Professional 2012, and selecting change. In the Visual Studio window I then selected repair.

As part of the repair process, I also had to download web deploy located here: http://www.microsoft.com/en-us/download/details.aspx?id=4148 and point the visual studio repair process to the .msi file when it said it couldn't find the web deploy package and could not download it from the internet.

I also had to implement the fix indicated in the following stackoverflow question: Plain C# Editor in Visual Studio 2012 (No intellisense, no indentation, no code highlighting)

Now I am able to debug applications as expected.

这篇关于Microsoft Visual Studio 2012无法在c#文件中设置断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆