Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

If you getting this error “Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure …” while trying to load Resources using ResourceManager from multi language assemblies it’s usually caused by loading the Resource file with this code:

 

<code>

ResourceManager resources = new ResourceManager(

                "<ResName>",

                Assembly.GetExecutingAssembly(),

                null );

 

</code>

 

While this code is suggested by MSDN : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemResourcesResourceManagerClassctorTopic4.asp, it’s missing the <WebProjectName>. So it should be like this:

 

ResourceManager resources = new ResourceManager(

    "<WebProjectName>.<ResName>",

     Assembly.GetExecutingAssembly(),

     null );

 

Where the resx files are named: <ResName>.<Culture>.resx

 

It’s also recommended to create only a single instance of the ResourceManager for your web app and to keep ResourceManager in a static class member or the Application object.  This causes the resources to be loaded only once per application.

Published Sunday, December 28, 2003 2:13 PM by nattYGUR

Comments

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Sunday, December 28, 2003 8:42 AM by Roy Osherove
I've also looked into the Microsoft localization toolkit, which adds some significant ease of use to localization issues. Recommended.

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Tuesday, February 3, 2004 8:37 PM by Martin
dear sir
i ahve created two res file one for german and one for french, and added these two files in my project ,
but its getting an error
error is

Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "TextRes.fr.resx.resources" was correctly embedded or linked into assembly "VBLocalLization". baseName: TextRes.fr.resx locationInfo: <null> resource file name: TextRes.fr.resx.resources assembly: VBLocalLization, Version=1.0.1495.16943, Culture=neutral, PublicKeyToken=null

This is my code


Public Function InitializeResources()
assembly1 = [Assembly].GetExecutingAssembly()
_resourceManager = New ResourceManager("TextRes.fr.resx", assembly1) _resourceManager.IgnoreCase = True
End Function
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
InitializeResources()

Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("fr-FR")
Thread.CurrentThread.CurrentUICulture = New CultureInfo("fr-FR")
Label1.Text = _resourceManager.GetString("Client Name")
Label1.Text = Label1.Text + _resourceManager.GetString("holiday name")
End Sub

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Tuesday, February 3, 2004 8:47 PM by Natty Gur
You are missing the <WebProjectName> in front of resource file name :
_resourceManager = New ResourceManager("MyAssembly.TextRes.fr.resx", assembly1)

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Wednesday, May 12, 2004 1:18 PM by Stonie
Thanks for this Blog!

I looked everwhere for this fix!

Cheers.
Stonie.

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Tuesday, May 18, 2004 5:08 PM by Do Quoc Binh
I copy this code in a new project it work fine but with old project it still have error.
Any help is appreciate.

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Tuesday, May 25, 2004 8:00 AM by Jeroen from the Netherlands
Thanks,

It really helped me. It worked instantly after some frustrating letter by letter checking of the 'sacred MSDN' (and other samples from gotdotnet) code...

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Monday, June 7, 2004 10:51 AM by Eusebio C Rufian-Zilbermann
Thank you, I finally got my multilingual web app working.

Something to note is that <WebProjectName> needs to be the complete namespace to the project

E.g.:

namespace A.B.C
{
public class MyForm
{
protected ResourceManager gResourceManager = new ResourceManager("A.B.C.<ResName>",typeof(MyForm).Assembly);
.
.
.
}
}

Cheers,

Eusebio

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Thursday, June 10, 2004 6:46 AM by Mark Bonafe
Great post! You just answered a problem I was having in a Windows application. It's not multilingual or anything special at all. I just created a control that needed a form inside it. In the InitializeComponents() method is a line similar to this:

System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(<ControlName>));

All I had to do, and your post is what answered it for me, was this:

System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(<Full.Namespace>.<ControlName>));

Thanks again

# It is the "default namespace" needed to set correctly.

Saturday, July 3, 2004 12:40 PM by Yangxin
I got the same problem, eventually I found out you need to right click on your project in VS and find your "default namespace". Insert the name before the resource name as "MyDefaultNamSpace.stringtable.resx".

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Thursday, December 13, 2007 9:44 AM by dan

i had this problem and solved it

the problem staarted after i wrote in Interface for the class i was using

hard to belive but

what caused the error was actually writing the interface over the class in the code file

after copy and pasting the code for the interface and replacinh it under the code for the class i didnt get this error any more.

hope it helps

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Monday, February 11, 2008 9:24 AM by Troy Gerton

EXCELLENT!  Thank you.  This problem cropped up when I converted a VS 2003 project to a VS 2005 project.  The code:

<code>

ResourceManager resources = new ResourceManager(

               "<ResName>",

               Assembly.GetExecutingAssembly(),

               null );

</code>

worked fine in VS 2003, but not in VS 2005.  NONE of the other forums, blogs, etc. I searched had the answer.  THANKS AGAIN!!

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Tuesday, March 11, 2008 5:26 AM by veera

Hi,

I'm not using any localization and any ResourceManager stuff. but i'm getting it when i deploy the application, "sdkerrors.resource" was correctly embedded ...  i never seen this error before, can anyone help me?

thanks

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Thursday, September 18, 2008 3:01 AM by Saima Riaz

use

new ResourceManager(Resources._string.ResourceManager.BaseName, Assembly.GetExecutingAssembly())

instaed of

New ResourceManager("TextRes.fr.resx", Assembly.GetExecutingAssembly())

it works for me....

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Monday, November 3, 2008 1:46 AM by ks.ajayverma

Hi I have done the same but not resolve my problem.

It is comming in the same way.

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Monday, November 3, 2008 2:08 AM by ks.ajayverma

I am getting the exception like

Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "SatelliteAssemblies.string.resources" was correctly embedded or linked into assembly "App_Web__c7iornx" at compile time, or that all the satellite assemblies required are loadable and fully signed.

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Monday, November 24, 2008 4:31 AM by c.life

i am gettting the same problem

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Monday, May 4, 2009 9:37 AM by ZV

pleaze someone POST CODE THAT WORKED FOR HIM>HER.

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Friday, July 3, 2009 10:24 AM by divyam.pr

This is my code

   public partial class MultilingualPage : System.Web.UI.Page

   {

       public ResourceManager rm;

       protected void Page_Load(object sender, EventArgs e)

       {

           CultureInfo ci;

           if (!IsPostBack)

           {

               Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

               rm = new ResourceManager("TheWorks.UI.MultilingualPage.aspx.en.resx",Assembly.GetExecutingAssembly(),null);

               ci = Thread.CurrentThread.CurrentCulture;

               LoadData(ci);

           }

           else

           {

               rm = new ResourceManager("TheWorks.UI.MultilingualPage.aspx.en.resx", Assembly.GetExecutingAssembly(),null);

               ci = Thread.CurrentThread.CurrentCulture;

               LoadData(ci);

           }

       }

       protected void LinkEnglish_Click(object sender, EventArgs e)

       {

           Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

           LoadData(Thread.CurrentThread.CurrentCulture);

           //Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");

           //LoadData(Thread.CurrentThread.CurrentUICulture);

       }

       protected void LinkFrench_Click(object sender, EventArgs e)

       {

           Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");

           LoadData(Thread.CurrentThread.CurrentCulture);

           //Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR");

           //LoadData(Thread.CurrentThread.CurrentUICulture);

       }

       public void LoadData(CultureInfo ci)

       {

           lblName.Text = rm.GetString("lblNameResource1", ci);

       }

       }

getting the same error .

Please help anyone

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Monday, December 21, 2009 11:14 AM by Diego F. (Uruguay)

Excelente, estoy con este problema hace horas y he probado varias cosas que dicen por Internet pero esta fue la que realmente funcionó. Gracias!!

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Tuesday, June 22, 2010 6:06 AM by craig

Just delete the .resx file then move any controls on that control/form then it will automatically generates another .resx file which is updated in your current version.

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Sunday, June 27, 2010 12:18 AM by shanthi bushan

i included resoource files (In /obj folder

those are excluded earlier )then i got error. so i excuded those files now application is working

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Tuesday, September 21, 2010 8:51 AM by Rumesh

I got the same error once because I included the debug and obj folders to the project. When the debug and obj folders are excluded project became normal

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Friday, October 21, 2011 9:05 AM by Seraj

This Solution is a sure shot.

Great.

Thanks

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Thursday, January 19, 2012 6:50 AM by Madesh G

I have converted from vs 2003 to 2010  after am getting some exception message.

{"Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "Infrature.Learning.CourseBuilder.SplashForm.resources" was correctly embedded or linked into assembly "Infrature.Learning.CourseBuilder" at compile time, or that all the satellite assemblies required are loadable and fully signed."}, please help me

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Monday, May 7, 2012 12:21 AM by Leon

Great article! We will be linking to this particularly great article on our website.

Keep up the great writing.

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Tuesday, April 2, 2013 10:52 PM by Tatum

Greetings from Ohio! I'm bored to death at work so I decided to check out your site on my iphone during lunch break. I really like the information you present here and can't wait to take a look when I get home.

I'm amazed at how quick your blog loaded on my cell phone .. I'm not even using

WIFI, just 3G .. Anyways, amazing site!

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Sunday, April 7, 2013 3:29 PM by Lawless

Now I am going away to do my breakfast, after having my breakfast

coming over again to read other news.

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Tuesday, April 23, 2013 3:44 AM by Miranda

SAY THANKS A LOT for returning this to my eyes, my children

will benefit a lot.

# re: Getting “Could not find any resources “error while using some resource files to make the internationalization of a ASP.NET application

Tuesday, May 28, 2013 2:20 PM by Toney

My family all the time say that I am wasting my time here at net, but

I know I am getting experience everyday by reading thes fastidious articles.