Bug 32499 - Win32 Icon Not Embedded When Compiled Under Linux
Summary: Win32 Icon Not Embedded When Compiled Under Linux
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2015-07-27 16:21 UTC by Mike Santiago
Modified: 2015-07-28 18:17 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Left: Windows built exe, right: Linux built .exe (17.48 KB, image/png)
2015-07-27 16:21 UTC, Mike Santiago

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Mike Santiago 2015-07-27 16:21:32 UTC
Created attachment 12242 [details]
Left: Windows built exe, right: Linux built .exe

(I wasn't sure whether this was a Monodevelop/Xamarin issue or an xbuild issue, I assumed xbuild because that actually compiles the icons)

OS: Debian 8.1 Stable
Mono Version: 4.0.2
Monodevelop Version: 5.9.4
Project Type: C#, compiled against the "Mono / .NET 4.5" option

My project when compiled under Linux, turns up with no errors and runs fine on Linux AND Windows. However, when I take the Linux built .exe and bring it to Windows, it has no icon. I have the Win32 Icon path filled in correctly in my Project Settings. In addition, the built exe is ~100kb smaller than a windows built one. When the same project running the same Mono version under the same Xamarin version is built under Windows, an icon is there and it is ~100kb larger than the Linux built .exe. Which leads me to believe that there's either a

-Bug in xbuild on Linux
-xbuild on Linux doesn't support embeddding of Win32 icons and that isn't documented anywhere. 

Both applications run just fine on either platform, the issue comes down to when users have the application pinned to their taskbar. The application updates and has no icon, suddenly their pinned version has no icon also. This works the same for desktop shortcuts also.
Comment 1 Mike Santiago 2015-07-27 16:32:38 UTC
Just found out that I was actually running msbuild under Windows, didn't know that.

I then ran xbuild and got the same results as my Linux machine. What is the solution to embedding a Win32 icon?
Comment 2 Marek Safar 2015-07-28 09:43:35 UTC
I cannot reproduce your issue. Please attach your csproj file.

Following command line works for me: mcs foo.cs -win32icon:exec_wine.ico
Comment 3 Mike Santiago 2015-07-28 09:48:47 UTC

just hastebinned the csproj, if you need the entire solution it's on GitHub

Comment 4 Mike Santiago 2015-07-28 09:56:54 UTC
Should I be using mcs as opposed to xbuild though?
Comment 5 Marek Safar 2015-07-28 18:17:57 UTC
Fixed in master