user1408767 user1408767 - 10 months ago 60
C# Question

Microsoft Visual Studio 2012 cannot set breakpoint in c# file

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

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download