Skip to content
This repository was archived by the owner on Dec 18, 2017. It is now read-only.
This repository was archived by the owner on Dec 18, 2017. It is now read-only.

Unable to load resources when they are under a namespace other than the assembly name #738

@kanchanm

Description

@kanchanm
  1. Create a vNext Class library e.g. EmbedResourceTest
  2. Add a resx file
  3. Change the namespace in the corresponding designer.cs file to EmbedResourceTest.Core
    note, you need to change here too -
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EmbedResourceTest.Core.EmbedMoreResources", typeof(EmbedMoreResources).GetTypeInfo().Assembly);

Try loading the resource, this will fail. If you ignore the namespace and change the above to not include the namespace it works fine.

global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EmbedResourceTest.EmbedMoreResources", typeof(EmbedMoreResources).GetTypeInfo().Assembly);

This is a very common pattern and it worked in the old world so although there is a workaround it is super painful to keep changing this when you are porting your application to vNext and have large number of resource files (which some projects do).

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions