Skip to content

GenerateResource cannot extract resources from ARM binaries #2253

Open
@rainersigwald

Description

@rainersigwald

This was reported via feedback as https://developercommunity.visualstudio.com/content/problem/54934/uwp-resx-strings-not-merged-into-the-pri-file-for.html and as https://connect.microsoft.com/VisualStudio/feedback/details/2345310/. Internal bug 189984.

If a UWP app project that builds an appx package refers to a DLL compiled for ARM that embeds resources, those resources are silently ignored rather than packaged into the PRI.

This is because of a BadImageFormatException

   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.UnsafeLoadFrom(String assemblyFile)
   at Microsoft.Build.Tasks.ProcessResourceFiles.ReadAssemblyResources(String name, String outFileOrDir) in E:\A\_work\8\s\src\Tasks\GenerateResource.cs:line 2958

 
Thrown here and silently ignored here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Task: GenerateResourceProblems with the task itself, resgen.exe, and resx resources in general.triaged

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions