MissingManifestResourceException with GetString

A

andrewbpark

Having a hell of time getting localization to work with the .NET CF.
I'm using the WorldClock example as a model.

I have three resource files defined in a folder named Resources:
strings.resx, strings.en-US.resx, and strings.zh-CHS.resx. These files appear to create the satellite assembles when I deploy. However, I keep getting a MissingManifestResourceException when calling ResourceManager.GetString. Shouldn't it "fall back" to the default resource and not throw this exception?

Basically all of the code is essentially the same as the WorldClock sample.

Two private variables are defined:
Private _rm As ResourceManager = Nothing
Private _ci As CultureInfo =
CType(CultureInfo.CurrentUICulture.Clone(), CultureInfo)

In the constructor:
Me._rm = New ResourceManager("MyApp.Resources.strings",
Me.GetType.Assembly)

In a wrapper function is the call to GetString:
Protected ReadOnly Property GetResourceString(ByVal key As String) As String Get Return _rm.GetString(key, _ci) End Get End Property

Couple of facts/questions that might help diagnose:
1. We are deriving our forms from our own base form.
2. I have a suspicion that the resx files for our forms are corrupt since we don't use the designer to place controls on the form (because we use our own that aren't designer enabled).
3. The exception gets thrown on both a US and Chinese Pocket PC.

Any guidence would be appreciated.
 
P

Pavel Treskunov [MSFT]

I would suggest that you check the correctness of the arguments that you
are passing to the constructor of ResourceManager.

Pavel Treskunov
.NET Compact Framework
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: (e-mail address removed)
Organization: http://www.wimdows.net/newsgroups/
X-Newsreader: Wimdows.net NntpNews
Subject: MissingManifestResourceException with GetString
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Date: Thu, 13 May 2004 12:54:00 -0700
NNTP-Posting-Host: www.interadahosting.com 64.85.9.61
Lines: 1
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09
.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.compactframework:53156
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Having a hell of time getting localization to work with the .NET CF.
I'm using the WorldClock example as a model.

I have three resource files defined in a folder named Resources:
strings.resx, strings.en-US.resx, and strings.zh-CHS.resx. These files
appear to create the satellite assembles when I deploy. However, I keep
getting a MissingManifestResourceException when calling
ResourceManager.GetString. Shouldn't it "fall back" to the default
resource and not throw this exception?
Basically all of the code is essentially the same as the WorldClock sample.

Two private variables are defined:
Private _rm As ResourceManager = Nothing
Private _ci As CultureInfo =
CType(CultureInfo.CurrentUICulture.Clone(), CultureInfo)

In the constructor:
Me._rm = New ResourceManager("MyApp.Resources.strings",
Me.GetType.Assembly)

In a wrapper function is the call to GetString:
Protected ReadOnly Property GetResourceString(ByVal key As String) As
String Get Return _rm.GetString(key, _ci) End Get End Property
Couple of facts/questions that might help diagnose:
1. We are deriving our forms from our own base form.
2. I have a suspicion that the resx files for our forms are corrupt since
we don't use the designer to place controls on the form (because we use our
own that aren't designer enabled).
3. The exception gets thrown on both a US and Chinese Pocket PC.

Any guidence would be appreciated.

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine
supports Post Alerts, Ratings, and Searching.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top