Visual Studio 2010 - 2013: ASPX view engine inserts extra Byte Order Marks "EF BB BF" in debug="true" mode - by Taras Kozubskij

Status : 

 


4
0
Sign in
to vote
ID 797767 Comments
Status Active Workarounds
Type Bug Repros 4
Opened 8/19/2013 9:19:15 AM
Access Restriction Public

Description

When I have such code:

var webDavFolderUrl = window.location.protocol + '//' + window.location.hostname + ':' + port + '<%=Request.ApplicationPath.TrimEnd('/')%>/';

resulting code will have extra "EF BB BF" symbols. But this issue can be reproduced when use such way of showing pages only:

Page page = (Page)System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(
            "~/MyCustomHandlerPage.aspx", typeof(Page));
        page.ProcessRequest(HttpContext.Current);
Sign in to post a comment.
Posted by Microsoft on 4/29/2014 at 12:29 PM
Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from: http://go.microsoft.com/?linkid=9832436
Posted by T.H Boonstra on 12/17/2013 at 3:05 AM
I ran into a similair issue with my project, strange characters randomly placed in my rendered HTML, while the project works fine in Visual studio 2012. However it would also randomly duplicate HTML tags near the end of my document and other cutoff html. Seeing as one of last things i saw was the HTML injected by Visual Studio 2013 Browser link functionalitiy tried disabling that, which fixed the problem for me.

So apperently the the Browser link function is injecting wrong and causing very strange side effects
Posted by neoprimetime on 11/14/2013 at 9:11 AM
My last bullet ... I meant to say
    - We rolled back to Visual Studio 2012, .NET 4.5.1 ... and it was successful ... no issues

so 2012 is fine, 2013 is not
Posted by neoprimetime on 11/14/2013 at 9:09 AM
I attached 3 files (in a zip) ...
- VisualStudio2013BadCharactersInASPX.pdf
- Default.aspx
- Main.master

Here is what we experience
- We were using Visual Studio 2012, .NET 3.5 (Websites)
- We upgraded to Visual Studio 2013, .NET 3.5 ... successfully, no issues
- A bit later ... we tried to upgrade to Visual Studio 2013, .NET 4.5.1 and ran into the following issues
--- Websites load and build just fine, but the website has major styling issues, it looks bad, in any browser (IE, Chrome, etc.)
--- We found that if we use Chrome or IE developer tools, we see lots of strange characters embedded (see attached PDF)
--- We found that if we do "Debug=true" the issue occurs, but if we put "Debug=false" the issues goes away
--- We do not see those characters in the files themself in Visual Studio, we also do not see it when we "view source" in the browser ... only in developer tools
- We rolled back to Visual Studio 2013, .NET 4.5.1 ... and it was successful ... no issues

So it appears there is something wrong is Visual Studio 2013 , .NET 4.5.1, Debug=true, and encoding of HTML
Posted by Roman Boiko on 8/20/2013 at 5:42 AM
My pc configuration: Internet Explorer 10.0.9200.16660, update version: 10.0.8 (KB2862772), Windows 7 Ultimate SP1, x64.
Posted by Roman Boiko on 8/20/2013 at 5:38 AM
With the new attachment I'm able to reproduce this as described.

Steps:

Open project in VS2012 (I have update 3 installed).
Select Internet Explorer for browsing & debugging. (This is mandatory, I couldn't reproduce the issue with Firefox.)
Execute Run Without Debugging (or press Ctrl+F5).
View source (should contain <p>"TEST"</p>, without white-space between quotes and TEST).

Do the same in VS2013 Preview.
Actual result: source looks like <p>"         TEST         "</p>, but instead of spaces there is UTF-8 BOM, as can be verified in a hex editor.
Expected result: <p>"TEST"</p>, without white-space.

Note that if Web.config is edited to contain     <compilation debug="false" targetFramework="4.5" />, then the issue is not reproducible.
Also, note that if a project is created from scratch in VS2013 Preview, and then files are added to it manually, then behavior is as I described in previous comment (i.e., can be reproduced regardless of VS version).

Posted by Roman Boiko on 8/20/2013 at 2:52 AM
Using attached project, I can only reproduce the issue when Web.config has <compilation targetFramework="4.0" debug="true" />, as opposed to <compilation targetFramework="4.0" debug="false" /> (regardless of Visual Studio version). I hit start without debugging in both cases.
Posted by Microsoft on 8/19/2013 at 7:55 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 8/19/2013 at 7:06 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)