Skip to content
This repository has been 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

Closed
kanchanm opened this issue Oct 10, 2014 · 4 comments
Assignees
Milestone

Comments

@kanchanm
Copy link

  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).

@glennc glennc added this to the Backlog milestone Oct 15, 2014
@glennc
Copy link
Member

glennc commented Oct 15, 2014

We need a few pieces to fall into place before we can solve this properly. Such as pre-processors.

alexmg added a commit to autofac/Autofac that referenced this issue Nov 28, 2014
@davidfowl
Copy link
Member

@muratg @Eilon I wanna change our resource format for beta3

@davidfowl davidfowl added the bug label Jan 22, 2015
@bojanrajkovic
Copy link

This also breaks trying to use EF6 migrations, as the embedded filenames for generated .resx files don't match what EF is looking for.

@davidfowl davidfowl modified the milestones: 1.0.0-beta3, Backlog Jan 22, 2015
@davidfowl davidfowl self-assigned this Jan 22, 2015
alexmg added a commit to autofac/Autofac that referenced this issue Feb 8, 2015
@muratg
Copy link
Contributor

muratg commented Feb 10, 2015

@davidfowl rc1?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants