2

When I'm building my project in production mode ng build --prod --output-path=../Angular --base-href=/autopoint/ --deploy-url=/autopoint/Angular/, a strange line at the top of the html before the tag appears but when I'm running it with an ng serve, it is gone. Any ideas what this might be caused by?

_Layout.cshtml

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AutoPoint</title>
    <base href="/" />
    <link href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,600,800&display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

    @Styles.Render("~/Angular/Styles")
</head>
<body id="app">

@RenderBody()


    @Scripts.RenderFormat("<script src='{0}' type='module'></script>", "~/Angular/Scripts")
    @Scripts.RenderFormat("<script src='{0}' nomodule defer></script>", "~/Angular/ScriptsIE")
</body>
</html>

Index.cshtml

<app-root></app-root>

enter image description here

enter image description here

Ivilin Stoyanov
  • 377
  • 3
  • 17
  • 1
    [BOM Characters](https://stackoverflow.com/questions/5406172/utf-8-without-bom) this link might help you... if you are using vs code for build it might save BOM characters also, so you can change settings, to avoid them. – pavan kumar Feb 12 '20 at 17:09
  • Tried to save the *_Layout.cshtml* file without BOM because I thought the problem might be in the @RenderBody(), the whitespace is moving with it no matter where I put it, but it didn't help at all. – Ivilin Stoyanov Feb 13 '20 at 17:14
  • 1
    Don't know if that solved your problem, but give it a try: https://stackoverflow.com/questions/12601957/strange-whitespace-appearing-in-mvc4-razor-view – G.Dimov Feb 14 '20 at 09:53

1 Answers1

1

Problem is solved. Invisible whitespace character. enter image description here

Ivilin Stoyanov
  • 377
  • 3
  • 17