Bug 57684 - resx Icon ico 256x256 or larger throws exception when compiling: Win32Exception: No valid icon entry were found at System.Drawing.Icon.InitFromStreamWithSize
Summary: resx Icon ico 256x256 or larger throws exception when compiling: Win32Excepti...
Status: NEEDINFO
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Drawing (show other bugs)
Version: master
Hardware: PC All
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-06-22 10:33 UTC by Pawel Troka
Modified: 2017-10-06 10:50 UTC (History)
2 users (show)

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


Attachments

Description Pawel Troka 2017-06-22 10:33:30 UTC
AFAIK this happens in all Mono versions (with msbuild and with xbuild). Doesn't happen under any .NET Framework version.

Example build:
https://travis-ci.org/PawelTroka/Computator.NET/jobs/245574349

Source of exception:
https://github.com/mono/mono/blob/master/mcs/class/System.Drawing/System.Drawing/Icon.cs#L758


Logs:
/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Properties/GraphicsResources.resx : error MSB3103: Invalid Resx file. Exception has been thrown by the target of an invocation. [/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Computator.NET.DataTypes.csproj]
/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Properties/GraphicsResources.resx : error : TargetInvocationException: Exception has been thrown by the target of an invocation. [/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Computator.NET.DataTypes.csproj]
/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Properties/GraphicsResources.resx : error :   at System.Resources.ResXResourceReader.LoadData () [0x00109] in <953259b13f9c4f60bc597f5b456f2625>:0  [/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Computator.NET.DataTypes.csproj]
/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Properties/GraphicsResources.resx : error :   at System.Resources.ResXResourceReader.GetEnumerator () [0x00008] in <953259b13f9c4f60bc597f5b456f2625>:0  [/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Computator.NET.DataTypes.csproj]
/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Properties/GraphicsResources.resx : error :   at Microsoft.Build.Tasks.ProcessResourceFiles.ReadResources (Microsoft.Build.Tasks.ProcessResourceFiles+ReaderInfo readerInfo, System.Resources.IResourceReader reader, System.String fileName) [0x00004] in <b2f7a995e9cd41dc9afc06c638dea9e8>:0  [/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Computator.NET.DataTypes.csproj]
/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Properties/GraphicsResources.resx : error :   at Microsoft.Build.Tasks.ProcessResourceFiles.ReadResources (System.String filename, System.Boolean shouldUseSourcePath, System.String outFileOrDir) [0x000a7] in <b2f7a995e9cd41dc9afc06c638dea9e8>:0  [/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Computator.NET.DataTypes.csproj]
/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Properties/GraphicsResources.resx : error :   at Microsoft.Build.Tasks.ProcessResourceFiles.ProcessFile (System.String inFile, System.String outFileOrDir) [0x000b3] in <b2f7a995e9cd41dc9afc06c638dea9e8>:0  [/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Computator.NET.DataTypes.csproj]
/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Properties/GraphicsResources.resx : error : Win32Exception: No valid icon entry were found. [/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Computator.NET.DataTypes.csproj]
/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Properties/GraphicsResources.resx : error :   at System.Drawing.Icon.InitFromStreamWithSize (System.IO.Stream stream, System.Int32 width, System.Int32 height) [0x001f3] in <c62946c3c87d4041b0fe488c1b65a112>:0  [/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Computator.NET.DataTypes.csproj]
/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Properties/GraphicsResources.resx : error :   at System.Drawing.Icon..ctor (System.IO.Stream stream, System.Int32 width, System.Int32 height) [0x00011] in <c62946c3c87d4041b0fe488c1b65a112>:0  [/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Computator.NET.DataTypes.csproj]
/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Properties/GraphicsResources.resx : error :   at System.Drawing.Icon..ctor (System.IO.Stream stream) [0x00000] in <c62946c3c87d4041b0fe488c1b65a112>:0  [/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Computator.NET.DataTypes.csproj]
/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Properties/GraphicsResources.resx : error :   at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) [/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Computator.NET.DataTypes.csproj]
/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Properties/GraphicsResources.resx : error :   at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <9da04a6d1127416ab693e39fe1629be8>:0  [/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Computator.NET.DataTypes.csproj]
/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Properties/GraphicsResources.resx : error :  [/home/travis/build/PawelTroka/Computator.NET/Computator.NET.DataTypes/Computator.NET.DataTypes.csproj]
Comment 1 Marek Safar 2017-10-06 10:50:23 UTC
Thank you for your report!

I’m unable to reproduce this issue locally using the information you provided. In order to investigate the issue further can you please attach a reproduction project and steps to reproduce this issue? For help on writing a bug report, please see our guide on this topic:

https://bugzilla.xamarin.com/page.cgi?id=bug-writing.html

Some of your next steps would be:

1. Including a sample project or steps to reproduce this problem
2. Your Version Information
3. Your expected results and actual results

Thank you!

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