0

The Debugged line is not getting highlighted in the cs-html page. It works perfectly when i am debugging in the cs page but unfortunately its not working for the cs-html page.

I tried changing the font size or background color from the Options->Fonts and colors.But still its not working.

Mike Brind
  • 28,238
  • 6
  • 56
  • 88
arunoday singh
  • 222
  • 2
  • 13
  • Hi friend, what's your vs version? And have you installed any third-party extension recently? Please try run vs in [safe mode](https://learn.microsoft.com/en-us/visualstudio/ide/reference/safemode-devenv-exe?view=vs-2019) and create a new project to check if it helps. Also, please make sure you place the breakpoint in .cshtml file, and it was hit. – LoLance Jun 10 '19 at 08:24
  • @LanceLi-MSFT i am using vs 2017 professional version. I havn't installed any third-party extension. I have just created a small MVC pages for my learning purpose only. I created a new project in the safe mode and i am not able to run the project as it saying to install or repair the debugger. – arunoday singh Jun 10 '19 at 17:56
  • The debugger is working perfectly fine in the controller page and its also highlighting the line, but its not highlighting whenever debugger is set in the cshtml page. – arunoday singh Jun 10 '19 at 17:58
  • Any update? Have you checked if my answer is helpful to resolve the issue? If the error still occurs please let me know. – LoLance Jun 13 '19 at 03:25

1 Answers1

0

Please check if you could get some help from this thread.

And I think what you mean is: When you set a breakpoint in the .cshtml file, the highlight does not work instead of during debug mode.(Any misunderstanding please correct me!)

If you set the breakpoint in the .cshtml file but no highlight you can try closing VS,go C:\Users\lancel\AppData\Roaming\Microsoft\VisualStudio to delete all 15.x folders. And restart VS to resolve it. (This solved the issue in my side, and you can try other suggestions from the link above)

If what you mean is the highlight not work in this situation:

enter image description here

Please go Tools menu=>Get Tools and Features to open installer and choose repair VS.

enter image description here Any update please feel free to let me know:)

LoLance
  • 25,666
  • 1
  • 39
  • 73
  • Sorry for the late reply. I tried the above method and also the solution given in that URL but its not working for me. If i set my debug point on the ViewTitle then that line is highlighted with the yellow color but the same is not happening when i set my debug point on the java-script functions. – arunoday singh Jun 14 '19 at 17:50
  • @arunodaysingh Hi friend, could you share a simple project sample which has same issue by one-drive or github to me, so that i can check it directly. – LoLance Jun 17 '19 at 10:13
  • i have uploaded Project as well as SQL scripts on the git link : https://github.com/arunoday153/VS-2017-Error... Please have a look...please help me as i am struck on this from a long time. – arunoday singh Jun 17 '19 at 17:54
  • @arunodaysingh Hi, I've downloaded it and trying to reproduce same issue but no luck that failed to hit the breakpoint. Let me confirm one point: If you set the breakpoint in the javascript function before starting debugging, what's the color? Does the line has the highlight? Please check [this issue](https://developercommunity.visualstudio.com/content/problem/58360/lost-intellisense-and-syntax-highlighting-for-csht.html), you can try 1: update your vs to latest version,2: Reinstall the ASP.NET and web development.3. Also, if you are VS for MAC, this option is not supported for now – LoLance Jun 18 '19 at 08:29
  • I updated my VS from 15.9.9 to 15.9.13 but still facing the same issue. To debug any java script functions i am just writing debugger inside that method.The color for that debug line remains black.When that debugger hits it opens up my that file(dyanmic) but its not highlighting which particular line its debugging.Any other sol left apart from reinstalling Visual Studio. – arunoday singh Jun 20 '19 at 17:10
  • Sorry for the delay. But I have no good idea for it now. And what do you mean writing debugger? Do you use [breakpoints](https://learn.microsoft.com/en-us/visualstudio/debugger/using-breakpoints?view=vs-2019) during debug in UI or by code using [Debugger.break method](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.debugger.break?redirectedfrom=MSDN&view=netframework-4.8#System_Diagnostics_Debugger_Break). – LoLance Jun 24 '19 at 09:00
  • 1
    I had to reinstall the Visual studio and now its working fine. Thanks for your help. – arunoday singh Jul 07 '19 at 16:39