Trouble with the BOM
When editing files in Visual Studio it decides sometimes to save UTF 8 encoded files with a preceding BOM (byte order mark). This happens especially when files contains non-ASCII characters like umlauts. For the programmer there is no easy way to see that the file will contain a BOM. The only way is to use "Save As" and then "Save with Encoding", which is quite cumbersome and probably nobody will take care.
However, such a BOM leads to problems when an HTML file with BOM is the start file of an app. In this case it will be automatically preceded by an HTML comment containing a manifest. The result that is send to the browser is now: manifest comment -> BOM -> HTML doctype -> and whatever HTML the original file contains. When a BOM occurs at other places than the beginning of a document it is treated as a content character. And now the browser inserts an implicit body element. Things that follow will now be treated as part of the body. That wouldn't be a big thing, because browsers have an error correction mechanism and will treat the head elements correctly even when placed in the body. But the problem is that the doctype is not recognized and browser will switch to "quirks mode", which leads e.g. to a different way how the width of boxes is calculated, so CSS is kind of broken. The "quirks mode" is how very old IEs calculated CSS elements, and this was not according to the standards.
Please change the way how the manifest is prepended so that it will be inserted after the BOM, if there is any, so that the BOM is still the first part of the resulting document.
I appended a screenshots. The first part shows the source view of the document that the browser receives. The BOM is located between comment and doctype (invisible in the screenshot). The code highlighting uses red color to show that there is something wrong. The second part shows the DOM that the browser has generated from this code. You can see there is no doctype declaration, the head is empty, and its content is treated as part of the body.
After saving the same document without BOM everything will be fine, no red colored syntax, the DOM view shows the doctype, and head and body have their designated content.

