Imagine that you have the following action in MVC 5 controller:

public string GetData()
	return JsonConvert.SerializeObject(
		new JObject(
			new JProperty("message", "Ok"), 
			new JProperty("data", new JObject(
				new JProperty("value", "< /body>")

We create simple object on a fly, serialize it to string and return. What you might actually get? Well:


< script type="application/json" id="__browserLink_initializationData">
< /script>
< script type="text/javascript" src="http://localhost:55192/9ff0617132d944e4bb76030619552ec4/browserLink" async="async">

< /body>"}}

So it looks like browser link decided to inject itself just before body ending tag.

Why did it do so? If we check response headers, we will see the following one:

Content-Type:text/html; charset=utf-8

So application decides to send html (instead of javascript) so browser link decides to inject itself. Solution is obvious:

Response.ContentType = "text/javascript";