10

After I upgraded to Asp.Net RC2 a couple of strange things started happening. I first thought that it might have something to do with how I ported my app. But creating a new default web app produces the same result when I run it:

enter image description here

Notice how everything in the head is now in the body (no idea why). This is causing some visual problems. This is one (along a couple others), there is a gap after the navbar and before the body:

enter image description here

After a while I tried running in Edge and Firefox, and it seems the problem only happens on Google Chrome. I absolutely made sure I have no BOM characters.

4 Answers 4

7

This is an issue with BrowserLink: https://github.com/aspnet/Mvc/issues/4671

0
4

As mentioned by @Tratcher it's an issue with BrowserLink. If you're not using it, just comment the line in Startup.cs that activates BrowserLink:

if (env.IsDevelopment())
{
    app.UseDeveloperExceptionPage();
    app.UseDatabaseErrorPage();
    //app.UseBrowserLink();
}
1

I had this problem and I don't use browser link. Check if there an Empty Line at the start of any .cshtml doc. Mostly its in the _Layout.cshtml. This worked for me.

1
  • In my case the line wasn't blank but the very first character was the &#65279 - invisible but deleteable.
    – tr3v
    Commented Sep 19, 2017 at 0:15
1

I had a similar issue, in my .cshtml file was UTF-8-BOM, I did use notepad++ to open the file and then switched using notepad++ Hexa editor plugin and noticed there was an invisible character just in front of @model. I did remove that character and changed the encoding of the file to UTF-8 and fixed the issue.

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.