I just installed Visual Studio 2017. After starting an ASP.NET MVC application I get the message that chrome debugging in Visual Studio is enabled.
But my breakpoints in Visual Studio won't hit. The breakpoints on Razor code seems to be working but Javascript does not. The breakpoints are not fully red like they should be. A restart, rebuild don't seem to take any effect.
I have the following code example
@Html.Partial("_Test", Model.Test) // debugging works here
<script>
var i = 1;
console.log(i); // debugging does not work here or above
</script>
@section scripts {
<script>
var a = 11;
console.log(a); // debugging does not work here or above
</script>
}
I don't have the chrome debugging console open and I checked the option in Visual Studio ('Enable Javascript debugging..') which is enabled.
According to this blog post I thought this should work: https://blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/
Am I missing something here? Could it be that this is not working in Visual Studio 2017 somehow?
I only have one extension and that is Resharper, but I guess this is not an issue.
Two options you could try:
Solution Explorer -> Internet Explorer -> <your view name>
. (Assumes you are using IE)After thinking the only way to get this working was to do a repair on Visual Studio 2017, using the installer, I realized that we had
BundleTable.EnableOptimizations = true;
inBundle.config
. I removed this line and added it toWeb.Debug.config
transformation and it started working as expected.I had to enable Legacy Chrome JavaScript debugger under:
It does work in vs 2017 only with enabling option "Enable Javascript Debugging for ASP.NET (Chrome and IE)" and setting debugger; in js code in *.cshtml as well as *.js file