-
Notifications
You must be signed in to change notification settings - Fork 65
Duplicate resource files using both dot naming and file naming disables all .resx lookups #209
Comments
What does Why would you have both files? |
Damian asked me to: Log a bug, but this is obviously a bit of an edge case, as you’re essentially duplicating the same resource. @Eilon Why would you have both files? You shouldn't and I'll document that. But the Entropy sample and my sample will show both approaches. Suppose you add a new type and it's associated resource - then are off that project for a few days. You return and add the same type resource with the alternative name. You app now fails silently. I was just hoping that when it fails it would throw an exception telling you why it failed. Perhaps this is enough of an edge case that I only need to document it. @hishamco #13 is "resource name is not found it throws" - this issue is that if you have two resources that are essentially the same resource (one uses the dot naming and the other the file naming) - not that the resource is missing. @Eilon In the Entropy sample, if you have both
It disables all resource files. _Resources\Views.Shared.Layout.fr.resx and all the other .resx files are not read. |
Ah, I see. I can only wonder what error we could show... I don't think we can know about the conflict until the app is running, so I don't think we can show an error during build. I can think of two options:
@DamianEdwards any preference as to the behavior? |
@Eilon logging a warning is good option, but can we align it with VS warning, so anyone using VS can see that too |
I don't think VS can show the warning because it's a runtime warning. VS isn't even in the picture anymore. |
I'm surprised this isn't failing at resource generation time (compile time). It can't embed both files with the same name, so it must either be embedding neither, or changing the names when embedding (e.g. append 1, 2 to the end). Can we check what the actual embedded resources look like in the project assembly after compile? |
@DamianEdwards is it possible that it gets embedded with both names? Or does it always embed with dots? @ryanbrandenburg can you take a look and see what's in the physical DLL in this scenario? |
@Eilon no, the |
Ok then that's indeed weird. |
Related to unrelated question, I faced a strange issue in the Entropy repo too while implementing a |
@hishamco as you said, that seems to be an unrelated question since there are no duplicate Resource files. Please post it as its own issue with more information. |
When I try to reproduce this I run into what @DamianEdwards expected, which is that it fails at compile time with |
Closing. I'm not building so I didn't see that error. I just change the resource files/code and dnx run. |
When you provide a resource file using both dot naming and folder naming, it disables the entire localization resource lookup. For example, if I have the following resource files in Entropy, no other non-conflicting .resx files are used.
The text was updated successfully, but these errors were encountered: