Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coreclr compiler does not embed native resources, E.g icons for vs #1172

Closed
KevinRansom opened this issue May 10, 2016 · 3 comments
Closed
Labels
Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone

Comments

@KevinRansom
Copy link
Member

KevinRansom commented May 10, 2016

in fsi on a windows PC run the following script on a build made with the coreclr compiler.

open System
open System.Runtime.InteropServices

module InteropWithNative =
    [<DllImport("shell32.dll", CharSet=CharSet.Auto)>]
    extern int32 ExtractIconEx(string szFileName, int nIconIndex, IntPtr[] phiconLarge, IntPtr[] phiconSmall,uint32 nIcons)

let n = 10 
let hIconLarge = Array.create n IntPtr.Zero
let hIconSmall = Array.create n IntPtr.Zero
let readIconCount = InteropWithNative.ExtractIconEx(@"D:\microsoft\visualfsharp\release\net40\bin\FSharp.ProjectSystem.FSharp.dll",0,hIconLarge,hIconSmall,uint32 n)
printfn "%d" readIconCount

outputs:

> 
0

module InteropWithNative = begin
  val ExtractIconEx :
    szFileName:string * nIconIndex:int * phiconLarge:IntPtr [] *
    phiconSmall:IntPtr [] * nIcons:uint32 -> int32
end
val n : int = 10
val hIconLarge : nativeint [] =
  [|-1334638209n; 249499511n; 96145467n; 189860057n; 0n; 0n; 0n; 0n; 0n; 0n|]
val hIconSmall : nativeint [] =
  [|247858027n; 991892445n; 616632265n; 138613021n; 0n; 0n; 0n; 0n; 0n; 0n|]
val readIconCount : int32 = 0
val it : unit = ()
>

Expected output:

4

...
@KevinRansom KevinRansom self-assigned this May 10, 2016
@KevinRansom KevinRansom added Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code. Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. Area-Compiler and removed Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code. FSI labels May 10, 2016
@dsyme dsyme removed the Regression label Nov 24, 2016
@dsyme
Copy link
Contributor

dsyme commented May 9, 2017

@KevinRansom Has this been fixed?

@dsyme
Copy link
Contributor

dsyme commented Jun 20, 2017

@KevinRansom Just to check - is this required in order to complete FSC on .NET Core? Just trying to work out the priority of this

@cartermp cartermp added this to the 16.0 milestone Aug 29, 2018
@cartermp cartermp modified the milestones: 16.0, 16.1 Feb 21, 2019
@cartermp cartermp modified the milestones: 16.1, 16.2 Apr 23, 2019
@cartermp cartermp modified the milestones: 16.2, Backlog Apr 30, 2019
enricosada added a commit to enricosada/Paket that referenced this issue Nov 28, 2019
to add icons with `fsc` it's possible to use native resources (like `<Win32Resource>paket.res</Win32Resource>`).
the `ApplicationIcon` property is not supported either ( ref dotnet/sdk#2818 ).

The `fsc` running on coreclr doesnt support yet native resources (ref dotnet/fsharp#1172 )

As workaround, a free tool (http://angusj.com/resourcehacker/) is used to add the icon after the exe is generated
@dsyme
Copy link
Contributor

dsyme commented Aug 26, 2020

This is fixed

@dsyme dsyme closed this as completed Aug 26, 2020
@cartermp cartermp modified the milestones: Backlog, 16.8 Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
None yet
Development

No branches or pull requests

3 participants