ststeiger / resxresourcereader Goto Github PK
View Code? Open in Web Editor NEWReader for .resx files (netstandard)
Reader for .resx files (netstandard)
I am trying to create a basic example using a single resx file from my dotnet core app to try and write the contents into a JS file for use in the browser. When I run it, and it gets to the foreach, it returns an error:
Could not find the resource "Fourstarzz.CopyTranslationsToJson.ResxReader.SR.resources" among the resources "System.Resources.NetStandard.SR.resources" embedded in the assembly "System.Resources.NetStandard", nor among the resources in any satellite assemblies for the specified culture. Perhaps the resources were embedded with an incorrect name.
I have no idea what Fourstarzz relates to other than a company in the US!
The code is:
using (var resourceReader =
new ResXResourceReader(Path.Combine(env.ContentRootPath, "Resources", "Controllers",
"AccountController.en.resx")))
{
foreach (DictionaryEntry entry in resourceReader)
{
// etc.
}
}
I have checked that the path definitely points to a resx file. I also tried to match the call stack to the source on github but it didn't seem to match.
The call stack is:
at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary2 localResourceSets, Boolean tryParents, Boolean createIfNotExists)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at System.Resources.NetStandard.SR.get_InvalidResXFileReaderWriterTypes()
at System.Resources.NetStandard.ResXResourceReader.ParseXml(XmlTextReader reader)
at System.Resources.NetStandard.ResXResourceReader.EnsureResData()
at System.Resources.NetStandard.ResXResourceReader.GetEnumerator()
at My.App.Core.Controllers.InternalController.GetJsTranslations(IWebHostEnvironment env) in C:\Users\luke\source\repos\My.App.Core\My.App.Core\Controllers\InternalController.cs:line 100
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.