I have some simple test code to prove out this weird behavior. The program runs without breakpoints. But if I set a breakpoint, it stops someplace in the json data and I can't single-step to debug my code. If I remove the json data, the breakpoints stop and I can single step from there (F10). Weird.
Here is my HTML code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>JSON Test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div id="header">
<h2>JSON Test</h2>
<label for="HostName">Your Node Name:</label>
<label id="HostName" style="width: 600px;"></label>
<label id="Status" style="text-align: center;"></label>
<input type="button" id="btnRefresh" value="Refresh Me" />
</div>
<script type="text/javascript">
$(document).ready(function () {
alert("Ready");
alert(data.name);
})
</script>
<script type="text/javascript">
var data = {
"id": 1,
"name": "abc",
"address": {
"streetName": "cde",
"streetId": 2
}
}
</script>
</body>
</html>
Set a breakpoint at alert ready. If you get the same results then it's an issue in Visual Studio. If not, then could it be in my method or version of VS 2017?? Strange.
And the issue was: I set set Google Chrome as the default debug browser. I switched it back to Internet Explorer and voila, I can debug again.