473,322 Members | 1,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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("AccountResources", Assembly.GetExecutingAssembly());

and in method

if (ex.Message.IndexOf("unq_a_AccountName") > 0)

throw new
AccountInformationException(stringManager.GetStrin g("accountWithNameExistsMessage"),
ex);

I get an error that Account.resource 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 3569
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********@gmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.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.String1;

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
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...
1
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...
2
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...
6
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...
1
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...
0
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...
3
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...
0
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: *...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.