Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Non-ResX resources get different resource IDs on Windows compared to C# #922
Folder names aren't respected when generating resource ids passed to the
open System open System.Reflection [<EntryPoint>] let main argv = Assembly.GetExecutingAssembly().GetManifestResourceNames() |> Array.iter (Console.WriteLine) 0 // return an integer exit code
Performing the same steps in a C# project results in
Note too that it isn't possible to override the resource id by using
in the msbuild file.
See https://bugzilla.xamarin.com/show_bug.cgi?id=37971 and fsharp/fsharp#50 for further background.
I seem to remember some subtle behaviour difference between the F# open edition and the Visual F# Tools here, due to some bug in Mono. It's possible that bug has now been fixed
@nosami could you check if this problem exists in Visual F# Tools, or just Mono F#, or both? thanks
The two bugs are present in both. xbuild delegates the task of generating resource Ids to FSharp.Build.dll which appears to come from this repo.
Note that Xamarin Studio recently started using code from MSBuild to build the code, so there is very little difference in the build process any more (if any). At some time in the past, it used it's own mechanism (which does actually do the correct thing here)
I created a repro solution here
I can't for the life of me work out where
BTW am I right in thinking that the command
@nosami I've clarified that for Windows this only applies to non-ResX resources. For Linux, when using XBuild, the problem also applies to ResX resources.
Applying a fix for this on Windows would be a breaking change - do you see if there's a way to fix this without a breaking change?
referenced this issue
Apr 9, 2016
Looking through the Xamarin code, it looks as if
It will be a breaking change for Mono too, so not sure what the answer is here. It's quite a big issue at the moment for us, because our msbuild task (which references FSharp.Build.dll) ends up generating the same resource ID for different icon sizes for iOS (same filename in different folders) and we have no workaround. I'd rather that you adopted the correct behaviour, but would understand if you can't.
Being able to use
I believe we'd be happy to fix this, but I looked around and really couldn't find where the LogicalName information was consumed. It's likely an easy fix but I don't have any leads right now. If you find something please send a link!