By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,056 Members | 1,320 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,056 IT Pros & Developers. It's quick & easy.

problems with Resource File

P: n/a
Hi,

I had an issue with loading/using resource file. I thought i will share
this information if it helpful some .

I have a console C# application and inside this i have class definition
as follows and my resource File name is

Resource File - Resource1
Namspace - EmployeeDetails
Class - EmployeeDetails

Default Namespace : Employee_Details [set by IDE] ???
namespace EmployeeDetails
{
/*1.*/ public static ResourceManager m_ResourceManager = new
ResourceManager("EmployeeDetails.Resource1",
System.Reflection.Assembly.GetExecutingAssembly()) ;

/*2.*/ public static System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(typeof(EmployeeDe tails));

class EmployeeDetails
{
static void Main()
{
Console.WriteLine(m_ResourceManager.GetString("Nam e"));

}
}

I had the following issue, when i specified the
<Namespace.ResourceNamefor the ResourceManager class object i was
getting the error "the resouece name specified is not appropriate for
the culture" and i was wondering what could be problem

for the Namespace and class name were same. But to my astonishment, i
opened the

Project Properties and i could see the deafult namespace as
"Employee_Details" and not as
EmployeeDetails. So i went to step 1 given above and changed the
Namespace to

Employee_Details.Resource and voila it worked

You can also try this..Hope this is useful.

Thanks
Gopal

Sep 30 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.