473,769 Members | 5,072 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem accessing string resources

Hi,
I am trying to globalize my application by separating out all the strings
into resource files. For testing purpose, I have created two resource files.
MyApp.resx, MyApp.en-US.resx. These resx files are built into binary
resource files(.resource s) and embedded into MyApp.exe by my make script.

The problem, Even after setting my machine culture to English -United
states, my application is always picking from the nuetral resource file. If
I dont link MyApp.resx(defa ult resource file) during make, it is throwing
MissingManifest ResourceExcepti on. While debugging, I found that CultureInfo
am getting using CurrentThread.C urrentCulture is giving the right culture
i.e en-US. Code snippet I have used is as below.
///////////////////////////
ResourceManager aResourceManage r = new ResourceManager ("Namespace.MyA pp",
System.Reflecti on.Assembly.Get ExecutingAssemb ly());

System.Globaliz ation.CultureIn fo aCultureInfo =
System.Threadin g.Thread.Curren tThread.Current Culture;

string test = aResourceManage r.GetString("te st", aCultureInfo); //Is always
picking from the string from the neutral resources file. Culture specific
string is never taken.

////////////////////////////

Could you please let me know where I am doing wrong.

Thanks,
Sreekanth.


Nov 16 '05 #1
1 2066
When I try to call ResourceManager .GetResourceSet () for the current thread's
culture, Am getting null. Any idea why it is so?
Thanks,
Sreekanth.
"Sreekanth" <sr*******@yaho o.com> wrote in message
news:cs******** *@news.mch.sbs. de...
Hi,
I am trying to globalize my application by separating out all the strings
into resource files. For testing purpose, I have created two resource files. MyApp.resx, MyApp.en-US.resx. These resx files are built into binary
resource files(.resource s) and embedded into MyApp.exe by my make script.

The problem, Even after setting my machine culture to English -United
states, my application is always picking from the nuetral resource file. If I dont link MyApp.resx(defa ult resource file) during make, it is throwing
MissingManifest ResourceExcepti on. While debugging, I found that CultureInfo am getting using CurrentThread.C urrentCulture is giving the right culture
i.e en-US. Code snippet I have used is as below.
///////////////////////////
ResourceManager aResourceManage r = new ResourceManager ("Namespace.MyA pp",
System.Reflecti on.Assembly.Get ExecutingAssemb ly());

System.Globaliz ation.CultureIn fo aCultureInfo =
System.Threadin g.Thread.Curren tThread.Current Culture;

string test = aResourceManage r.GetString("te st", aCultureInfo); //Is always picking from the string from the neutral resources file. Culture specific
string is never taken.

////////////////////////////

Could you please let me know where I am doing wrong.

Thanks,
Sreekanth.

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1174
by: Frank L | last post by:
Greetings, I am somewhat puzzled by a difference that occurs when I compile my web application out of VS.NET or if I compile it through NAnt. The issue is with how the resources get compiled into the application's dll file. Using the Reflector application I can see that VS.NET comiles the default language resource into the main dll while putting other languages into so-called satellite assemblies to folders which are named after the...
3
15639
by: Jagdip Singh | last post by:
Hi, We are facing problem accessing to DB2. Seems like database manager is down I tried starting it using db2start but it was neither showing any messages nor returning to command prompt after finishing start. I do not know actually if it was trying to start database or hanging somewhere
0
2266
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or updating the code-behind dll) accessing any aspx page in the application causes the application to run for the first time. Some of the initialization involves reading and writing some text and xml files using simple streamreader and streamwriter...
2
5523
by: Fredrik Rodin | last post by:
All, I'm having problems with my resource manager in ASP.NET 2.0 after conversion from ASP.NET 1.1. Here is a background: In ASP.NET 1.1 All my user controls and aspx pages inherit from base classes. A base class includes this property (among others...;-)):
8
13046
by: Ben Fidge | last post by:
Hi I have a small WinForms app that needs to copy files from a shared drive on a network. If I connect to the mapped drive using Explorer, a password dialog pops-up and I have to provide credentials with permission to access this resource on the machine where it's hosted. This is once for each desktop logon session (ie after every reboot). If I do this, my app can access the network resource fine, but otherwise fails with permission...
3
2013
by: C-Services Holland b.v. | last post by:
Hi all, I've created a custom button which I can stick into my toolbox. This all works well and I see my button in the designer. This button uses customised graphics and I want to stick it in the dll as an embedded resource. In the project tree I added a folder in which I stick the bitmaps (png's actually) and set he compile option for them to EmbeddedResource. But how do I access them from my (vb)source? The docs say:
1
2780
by: Damien \zaide\ Desmarets | last post by:
Hi, I have a little problem with the 2.0 framework. I use a web farm with 2003 server and IIS. I have installed SFU 3.5 to use NFS on windows, it works great with ASP.NET 1.1 and IIS 6.0. So I have tried to install the 2.0 framework to use it and then i get some problem. I have make a small hello world on my local computer, then installed it and configured a website on it localy (on the web server directly) and it work fine. After that...
4
1858
by: TCook | last post by:
Hey All, I am building a solution which will have many strings that will need to be localized (i.e. strings for toolbars, strings for different WinForms, strings for messages and error messages, etc.). I am having trouble accessing string file resources. What I want to do is to break out strings into separate files so that they are easier to manage and such that I don't have to look through hundreds to
0
1774
by: ramesh.nrk | last post by:
Hi, I am developing a windows application which should support different language for this I am using "Resource Manager" default in .net framework. Here I am developing dll for Resource because there are different application which can access one dll avoid duplications. Resource File Name : Resources/MyAppResource.de.resx
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10048
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9996
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.