473,756 Members | 3,482 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't get hold of resources in .resx files

I just started trying localization for my web application.
I have class library as part of solution so I need to globalize / localize
this component too.

I created resource file in the assembly itself - Account.resx - the one that
VS offers.
And wrote code like this.

static ResourceManager stringManager=

new ResourceManager ("AccountResour ces", Assembly.GetExe cutingAssembly( ));

and in method

if (ex.Message.Ind exOf("unq_a_Acc ountName") > 0)

throw new
AccountInformat ionException(st ringManager.Get String("account WithNameExistsM essage"),
ex);

I get an error that Account.resourc e is not part of assembly.

Well I have Account.resx and VS2005 doesn't offer .resource.

So what should I do?

Thank you,

Shimon.
May 15 '06 #1
3 3592
Hi Shimon

Whenever I come across resource issues, the majority of the problems
are to do with how you have named the resource file inside your
assembly.

Use the Reflector http://www.aisto.com/roeder/dotnet/ to open your
assembly up and see how the resource file has been named. Odds on it is
your naming that is the problem.

Cheers

Tim

May 15 '06 #2
Thank you.
You are correct.
Thank you for tool.
Shimon.
"Tim Ferris" <ti********@gma il.com> wrote in message
news:11******** **************@ j73g2000cwa.goo glegroups.com.. .
Hi Shimon

Whenever I come across resource issues, the majority of the problems
are to do with how you have named the resource file inside your
assembly.

Use the Reflector http://www.aisto.com/roeder/dotnet/ to open your
assembly up and see how the resource file has been named. Odds on it is
your naming that is the problem.

Cheers

Tim

May 15 '06 #3
Hi Shimon,

As for accessing resource items in localized resource file(resx ) compiled
in VS 2005 projects, the VS 2005 ide will help automatically generate
resource accessor class to access the resource items. We can call them to
retrieve resource items, e.g:

suppose I have a class library project (named SBI) in vs 2005, and add a
Resouce1.resx file(contains some string items like String1, String2....),
the IDE will help automatically generate the helper class so that we can
access the resource in the Resource1.resx file like below:

string str1 = SBI.Resource1.S tring1;

Also, we can use the resgen.exe tool to manually create such resource
accessor helper class:

#Resource File Generator (Resgen.exe)
http://msdn2.microsoft.com/en-us/library/ccec7sz1.aspx

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support
=============== =============== =============== =====

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



May 15 '06 #4

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

Similar topics

1
2294
by: Stefan Turalski \(stic\) | last post by:
Hi, What I need to do is adding some support for resources files to my application. What I did is: MyAppMain <- startup project MyAppHelper <- project which has MyAppResourcesClass (al a library project) This class call methode : ResourceManager MyAppResourceManager = new ResourceManager("MyAppMain.Resources", Assembly.GetExecutingAssembly()); and I obtain error which tell that there is no propertly added
1
2065
by: Sreekanth | last post by:
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(.resources) 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....
2
2017
by: Paul | last post by:
I have plugged the ExceptionManagement app block into our framework and have a question about resource files. ExceptionManagerText.resx is one of resource files in the project. When you look at .dll's manifest in the disassembler the file is ExceptionManagerText.resources. When/How is the file transformed from it's text form, .resx, to it's binary form, ..resources? HTH: I was getting the error: "Could not find any resources appropriate...
6
6224
by: dhnriverside | last post by:
Yup - I'm having one of those days! I've just deleted the wrong RESX file (ie one that was in use!) and now my project wont compile. How can I rebuild the resx file, or get it back!? (didnt go into the bin!). Ta Dan
1
1226
by: Lucvdv | last post by:
In an app that was working, all I did was specify an icon for the main form (through the form designer) and recompile it. Result: MissingManifestResourceException After digging around, I found that the compiler generates .resource files in the debug build of the application, for all forms except the main one (form1). The .resx file (with the icon in it) exists in the source directory,
0
254
by: Bob | last post by:
Hi, VS2005 First time with a multi language app. I have made a resx files strings.en-US.resources.resx , strings.fr-FR.resources.resx There is a string resource in each called culturename I have also added culturename to the Default resource file Resources.resx using the resource editor Project - Properties - Resources. I clean the project and 'rebuild - Solution'. The output window shows these files being compiled into a dll
3
4029
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user selects? thanks...
0
1315
by: =?Utf-8?B?TWF0dE0=?= | last post by:
I'm trying to figure out if it's possible in VS2005 to get strongly typed resources using an external assembly that contains string resx files. Here are some bullets on what I'm trying to do: * I want to manage common strings in a resx file that is in a separate project from my web application. * I want to be able to use strongly type names in the web app to refer to the external resx file values * I want to be able to update the data...
0
903
Frinavale
by: Frinavale | last post by:
I've been spending most of my day thoroughly investing the use of resource (resx) files in applications. I have noticed that the designer files that are automatically created for resx files by Visual Studio (or ResGen) contain a private shared/static instances of a ResourceManager and a CultureInfo. They also contain a bunch of public shared properties with names that match the Key Names of my resource strings. These properties return...
0
9462
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
9287
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
10046
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...
1
9857
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
9722
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7259
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
6542
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3817
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3369
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.