Skip to content

StronglyTypedResourceBuilder/ResXCodeFileGenerator output isn't strongly typed #4582

Closed

Description

@rainersigwald

After #4420, this line no longer finds full-framework loaded-from-resx types:

https://github.com/microsoft/msbuild/blob/d31fdbf016616835b237d2846f3f1535560bb2d5/src/Tasks/system.design/stronglytypedresourcebuilder.cs#L109

and they always fall back into the "just emit object" case:

https://github.com/microsoft/msbuild/blob/d31fdbf016616835b237d2846f3f1535560bb2d5/src/Tasks/system.design/stronglytypedresourcebuilder.cs#L126-L130

This is a breaking change for consumers who expected StronglyTypedResourceBuilder to emit . . . strong types.

This is the root cause of dotnet/wpf#1495. Thanks for debugging it, @ericstj!

Activity

  1. added
    Area: Tasks
    Area: Task: GenerateResource
    on Aug 5, 2019
  2. added this to the MSBuild 16.3 milestone on Aug 5, 2019
  3. self-assigned this
    on Aug 5, 2019
  4. changed the title [-]StronglyTypedResourceBuilder/ResXCodeFileGenerator isn't strongly typed[/-] [+]StronglyTypedResourceBuilder/ResXCodeFileGenerator output isn't strongly typed[/+] on Aug 5, 2019
  5. rainersigwald commented on Aug 6, 2019

    @rainersigwald
    MemberAuthor

    There's a fairly easy fix for this for the old deserialize-the-stuff-from-the-resx mechanism, but things will be more complex when trying to use the new System.Resources.Extensions approach. For most types of resource, we can get a type from the resx (we may have to do some manipulation to get it out of an assembly-qualified type name), but for some they're entirely hidden behind BinaryFormatter serialization.

    I put up #4588 to fix the worst regression in existing cases. It is not enough to fix the WPF problem. I'm still plugging.

  6. rainersigwald commented on Aug 20, 2019

    @rainersigwald
    MemberAuthor

    Fixed by #4588

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

.NET CoreArea: Task: GenerateResourceArea: Taskstriaged

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions