The situation:
- I have a class library, called
RT.Servers
, containing a few resources (of typebyte[]
, but I don't think that's important) - The same class library contains a method which returns one of those resources
- I have a simple program (with a reference to that library) that only calls that single method
I get a MissingManifestResourceException
with the following message:
Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Servers.Resources.resources" was correctly embedded or linked into assembly "RT.Servers" at compile time, or that all the satellite assemblies required are loadable and fully signed.
I have never played around with cultures, or with assembly signing, so I don't know what's going on here. Also, this works in another project which uses the same library. Any ideas?
When I run in a similar issue, in Vs 2012, it turned out that the "Custom Tool Namespace" property of the resx file was wrong (in my case, actually, it was unset, so the generated code yeld this exception at runtime). My final set of properties for the resx file was something like this:
Recently ran into the same problem, struggled for a bit, found this topic but no answers were correct for me.
My issue was that when I removed main window from my WPF project (it does not have a main window), I forgot to remove
StartupUri
fromApp.xaml
. I guess this exception can happen if you have a mistake inStartupUri
, so in case if anybody is struggling with this - check yourStartupUri
inApp.xaml
.Recently stumbled upon this issue, in my case I did a few things:
Make sure the namespaces are consistent in the Designer.cs file of the resx file
Make sure the default namespace of the Assembly(right click the project and choose Properties) is set the same to the namespace the resources file is in.
Once I did step 2, the exception went away.
Not sure it will help people but this one worked for me :
So the issue I had was that I was getting the following message:
I was trying to get the resources that were embedded in my project from another class library.
What I did to fix the problem was to set the Access Modifier in the tab Project->Properties->Resources from "Internal" (accessible only within the same class library) to "Public" (accessible from another class library)
Then run and voilà, no more error for me...
All I needed to do to fix this problem was to right-click the
Resources.resx
file in the Solution Explorer and click Run Custom Tool. This re-generates the auto-generatedResources.Designer.cs
file.If the .resx file was added to the project manually, the Custom Tool property of the file must be set to "ResXFileCodeGenerator".
The problem is due to a mismatch of namespaces, which occurs if you change the "default namespace" of the assembly in the project settings. (I changed it from (previously)
"Servers"
to (now)"RT.Servers"
.)In the auto-generated code in
Resources.Designer.cs
, there is the following code:The literal string
"Servers.Resources"
had to be changed to"RT.Servers.Resources"
. I did this manually, but running the custom tool would have equally well done it.I had the with a newly created F# project. The solution was to uncheck "Use standard resource names" in the project properties -> Application -> Resources / Specify how application resources will be managed. If you do not see the checkbox then update your Visual Studio! I have 15.6.7 installed. In 15.3.2 this checkbox is not there.