You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.
I am working on porting a library and am hitting some issues while trying to restructure it. Since I am reusing the code that targets older MVC version and essentially doing #if-#defs for K I am referencing code/resource files from a folder that is different from where the kproj/project.json lives. Referencing code works fine for me but I am hitting issues with resources and the only way I could get it to work is placing them under the same folder as the K project files.
Here are the things I have tried so far:
DOESN’T WORK: Specify the code and resource files as below. This gives build errors complaining about missing some of the resources specified in the cs file under \Resources.
"code": "../XYZ/*/.cs",
“resources”: "../XYZ/Resources/.",
DOESN’T WORK: Specify the code and resource files as below. This builds but throws during runtime as it is unable to load the resources.
System.Resources.MissingManifestResourceException occurred
HResult=-2146233038
Message=Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "XYZ.Resources.Messages.resources" was correctly embedded or linked into assembly "XYZ.K" at compile time, or that all the satellite assemblies required are loadable and fully signed.
Source=mscorlib
StackTrace:
at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at FluentValidation.Resources.Messages.get_notnull_error() in C:\Users\kanchanm\Documents\Visual Studio 14\Projects\XYZ\src\FluentValidation\Resources\Messages.Designer.cs:line 192
at XYZ.Resources.LocalizedStringSource.GetString() in C:\Users\kanchanm\Documents\Visual Studio 14\Projects\fluentvalidation\src\XYZ\Resources\LocalizedStringSource.cs:line 74
InnerException:
WORKS: Duplicate the contents of “../XYZ/Resources“ under the XYZ.K project and exclude the ones under the XYZ itself.
"code": "../XYZ/*/.cs",
"exclude": "../XYZ/Resources",
Note, you may see some oddities here still since there is another issue in this scenario that the namespace of the resources need to be XYZ and the original one XYZ. Resources doesn’t work in the new world (works in the old world) for some reason which seems like a different issue.
The text was updated successfully, but these errors were encountered:
copy *.resx files into the new ASP.NET Core 5.0 project directory because nothing in project.json extends the files ResxResourceProvider processes. (copying the files is not a viable workaround except in the very short term.)
execute .\build.cmd resx to create a new *.designer.cs file since one original doesn't use the resource names ResxResourceProvider produces.
remove all the extra *.resx files the previous step generated 😦
update the "code" array in project.json to use the new *.designer.cs file
I am working on porting a library and am hitting some issues while trying to restructure it. Since I am reusing the code that targets older MVC version and essentially doing #if-#defs for K I am referencing code/resource files from a folder that is different from where the kproj/project.json lives. Referencing code works fine for me but I am hitting issues with resources and the only way I could get it to work is placing them under the same folder as the K project files.
Here are the things I have tried so far:
"code": "../XYZ/*/.cs",
“resources”: "../XYZ/Resources/.",
System.Resources.MissingManifestResourceException occurred
HResult=-2146233038
Message=Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "XYZ.Resources.Messages.resources" was correctly embedded or linked into assembly "XYZ.K" at compile time, or that all the satellite assemblies required are loadable and fully signed.
Source=mscorlib
StackTrace:
at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at FluentValidation.Resources.Messages.get_notnull_error() in C:\Users\kanchanm\Documents\Visual Studio 14\Projects\XYZ\src\FluentValidation\Resources\Messages.Designer.cs:line 192
at XYZ.Resources.LocalizedStringSource.GetString() in C:\Users\kanchanm\Documents\Visual Studio 14\Projects\fluentvalidation\src\XYZ\Resources\LocalizedStringSource.cs:line 74
InnerException:
"code": "../XYZ/*/.cs",
"exclude": "../XYZ/Resources",
Note, you may see some oddities here still since there is another issue in this scenario that the namespace of the resources need to be XYZ and the original one XYZ. Resources doesn’t work in the new world (works in the old world) for some reason which seems like a different issue.
The text was updated successfully, but these errors were encountered: