Bug 58301 - Text editor adds byte order mark (BOM) to modified files
Summary: Text editor adds byte order mark (BOM) to modified files
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General (show other bugs)
Version: 4.6.0 (15.3)
Hardware: PC Windows
: Normal normal
Target Milestone: 15.6
Assignee: Bugzilla
Depends on:
Reported: 2017-07-21 18:14 UTC by Jon Douglas [MSFT]
Modified: 2017-10-06 01:20 UTC (History)
5 users (show)

See Also:
Tags: ac
Is this bug a regression?: ---
Last known good build:


Description Jon Douglas [MSFT] 2017-07-21 18:14:07 UTC
*Description with Use-case:

In Xamarin.Android and using the "Proguard" feature, one can specify a custom Proguard.cfg file which specifies rules for Proguard to follow.

To do this, one would create a new file called "Proguard.cfg" and add the Build Action of "ProguardConfiguration".

Now the user can add their rules inside this Proguard.cfg file. The problem however is that the Proguard.jar tooling requires the file to not have a BOM(byte order mark). I describe this problem here:


Now although this is a more generic issue regarding adding a BOM to any modified file, it makes the use case of editing any file that needs to have no BOM almost impossible. Thus the user would have to stay away from Visual Studio when editing these files to ensure the BOM isn't re-added.

I've tried just about every editor inside the "Open With" dialog, but they all seem to re-add the BOM.

There is a very similar issue for Visual Studio for Mac here:


*Expected Behavior:

Saving a file without BOM would remain without a BOM

*Actual Behavior:

Saving a file without BOM adds a BOM causing tooling to fail

*Version Information:

Microsoft Visual Studio Enterprise 2017 
Version 15.2 (26430.16) Release

Xamarin (fec6f88)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK (9dbc4c5)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK (ad35de4)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 1 Prashant [MSFT] 2017-07-24 06:38:07 UTC
I can confirm using the latest Visual Studio 2017 Preview version 15.3 I am able to reproduce this issue. Marking this report as CONFIRMED. 

However, you can find the work around at https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/proguard/#File_Issues
Comment 2 Pierce Boggan [MSFT] 2017-08-21 18:11:01 UTC
This issue makes Proguard very difficult to work with on Windows (which most serious apps will be using). We should try and fix this in 15.5 if possible.
Comment 3 Pierce Boggan [MSFT] 2017-09-13 20:58:05 UTC
Tentatively moving this feature work to 15.6. We will create an associated work item for tracking in VSTS when we begin work on that milestone.
Comment 4 Pierce Boggan [MSFT] 2017-10-06 01:20:10 UTC
Thanks for taking the time to report this issue. :)

Given this is a feature request or enhancement, I am closing this issue and adding a work item to our backlog.

Note You need to log in before you can comment on or make changes to this bug.