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

Problem with Resources

P: n/a
OK, for a number of reasons I have needed to begin experimenting with
resources sooner than I had planned (I had avoided it for now).

Step 1: I built the 'reseditor' application that is in the SDK
sub-directory, as instructed by the MSDN.

Step 2: I used the 'reseditor' to create a file named
"MyResources.resources" that contains only some string resources.

Step 3: I added this resource file to my existing test assembly (does not do
anything other than test the use of the string resources to generate
altername 'names' for enumerated values).

Step 4: In the class definition (for my form since that is all there is in
this test code), I added "ResourceManager _Resources;".

Step 5: In the constructor for this form I added "_Resources = new
ResourceManager("MyResources", Assembly.GetExecutingAssembly());" (I
actually wrapped this in a try/catch block just in case, but the code does
not cause an exception).

Step 6: In my code I generate the name of the resource string I want and
attempt to retrieve it: "result.Append("[Retrieved] " +
_Resources.GetString(resourceName));" -- I have checked that the name I am
passing is the name of one of the strings in the resource file.

Step 7: I get a MissingManifestResourceException reporting that it "Could
not find any resources appropriate for the specified culture (or the neutral
culture) in the given assembly."

Step 8: This fails for any string I attempt to read.

Step 9: If I examine the binary of the resource file (which is in the
assembly), the contents indicate that it is for the neutral culture.

What am I doing wrong?

-Ken
Nov 16 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Hello Ken,

Examine the assembly with the ILDASM tool to find out the real name of the
resource file. It will most likely be prefixed with the default namespace
name.
Therefore, on Step 5, you should specify the name of the resource file as:

"MyNamespace.MyResources"

"Ken Allen" <ke******@sympatico.ca> wrote in message
news:Oc*************@TK2MSFTNGP12.phx.gbl...
OK, for a number of reasons I have needed to begin experimenting with
resources sooner than I had planned (I had avoided it for now).

Step 1: I built the 'reseditor' application that is in the SDK
sub-directory, as instructed by the MSDN.

Step 2: I used the 'reseditor' to create a file named
"MyResources.resources" that contains only some string resources.

Step 3: I added this resource file to my existing test assembly (does not do anything other than test the use of the string resources to generate
altername 'names' for enumerated values).

Step 4: In the class definition (for my form since that is all there is in
this test code), I added "ResourceManager _Resources;".

Step 5: In the constructor for this form I added "_Resources = new
ResourceManager("MyResources", Assembly.GetExecutingAssembly());" (I
actually wrapped this in a try/catch block just in case, but the code does
not cause an exception).

Step 6: In my code I generate the name of the resource string I want and
attempt to retrieve it: "result.Append("[Retrieved] " +
_Resources.GetString(resourceName));" -- I have checked that the name I am
passing is the name of one of the strings in the resource file.

Step 7: I get a MissingManifestResourceException reporting that it "Could
not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly."

Step 8: This fails for any string I attempt to read.

Step 9: If I examine the binary of the resource file (which is in the
assembly), the contents indicate that it is for the neutral culture.

What am I doing wrong?

-Ken


Nov 16 '05 #2

P: n/a
Hmmm. Using ILDASM I can see the file names in the manifest, but it is not
listed in the assembly itself -- at the top level I see MANIFESZT and
"EnumerationNaming" (the name of my assembly/solution), and inside
"EnumerationNameing" all I see is Form1 and the publuc enum "MyStates",
which are all that were defined in the Form1.cs file! In the manifest I see
these lines:

..mresource public EnumerationNaming.MyResources.resources
{
}
..mresource public EnumerationNaming.Form1.resources
{
}

I added the reopsurce file by copying the MyResources.resources file to the
same directory as the Form1.cs file and then performed an "Add Existing..."
function to add the file -- and it appears in the solution explorer!

I do not understand!

-Ken

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:uU**************@TK2MSFTNGP12.phx.gbl...
Hello Ken,

Examine the assembly with the ILDASM tool to find out the real name of the
resource file. It will most likely be prefixed with the default namespace
name.
Therefore, on Step 5, you should specify the name of the resource file as:

"MyNamespace.MyResources"

"Ken Allen" <ke******@sympatico.ca> wrote in message
news:Oc*************@TK2MSFTNGP12.phx.gbl...
OK, for a number of reasons I have needed to begin experimenting with
resources sooner than I had planned (I had avoided it for now).

Step 1: I built the 'reseditor' application that is in the SDK
sub-directory, as instructed by the MSDN.

Step 2: I used the 'reseditor' to create a file named
"MyResources.resources" that contains only some string resources.

Step 3: I added this resource file to my existing test assembly (does not
do
anything other than test the use of the string resources to generate
altername 'names' for enumerated values).

Step 4: In the class definition (for my form since that is all there is

in this test code), I added "ResourceManager _Resources;".

Step 5: In the constructor for this form I added "_Resources = new
ResourceManager("MyResources", Assembly.GetExecutingAssembly());" (I
actually wrapped this in a try/catch block just in case, but the code does not cause an exception).

Step 6: In my code I generate the name of the resource string I want and
attempt to retrieve it: "result.Append("[Retrieved] " +
_Resources.GetString(resourceName));" -- I have checked that the name I am passing is the name of one of the strings in the resource file.

Step 7: I get a MissingManifestResourceException reporting that it "Could not find any resources appropriate for the specified culture (or the

neutral
culture) in the given assembly."

Step 8: This fails for any string I attempt to read.

Step 9: If I examine the binary of the resource file (which is in the
assembly), the contents indicate that it is for the neutral culture.

What am I doing wrong?

-Ken

Nov 16 '05 #3

P: n/a
> .mresource public EnumerationNaming.MyResources.resources
{
}
This is the one you need. Therefore, you should change Step 5 to the
following:

_Resources = new ResourceManager("EnumerationNaming.MyResources",
Assembly.GetExecutingAssembly());

I really cannot explan why VS .NET appends the name of the namespace to the
name of the resource file itself,
it just works this way.
"Ken Allen" <ke******@sympatico.ca> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl... Hmmm. Using ILDASM I can see the file names in the manifest, but it is not
listed in the assembly itself -- at the top level I see MANIFESZT and
"EnumerationNaming" (the name of my assembly/solution), and inside
"EnumerationNameing" all I see is Form1 and the publuc enum "MyStates",
which are all that were defined in the Form1.cs file! In the manifest I see these lines:

.mresource public EnumerationNaming.MyResources.resources
{
}
.mresource public EnumerationNaming.Form1.resources
{
}

I added the reopsurce file by copying the MyResources.resources file to the same directory as the Form1.cs file and then performed an "Add Existing..." function to add the file -- and it appears in the solution explorer!

I do not understand!

-Ken

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:uU**************@TK2MSFTNGP12.phx.gbl...
Hello Ken,

Examine the assembly with the ILDASM tool to find out the real name of the
resource file. It will most likely be prefixed with the default namespace name.
Therefore, on Step 5, you should specify the name of the resource file as:
"MyNamespace.MyResources"

"Ken Allen" <ke******@sympatico.ca> wrote in message
news:Oc*************@TK2MSFTNGP12.phx.gbl...
OK, for a number of reasons I have needed to begin experimenting with
resources sooner than I had planned (I had avoided it for now).

Step 1: I built the 'reseditor' application that is in the SDK
sub-directory, as instructed by the MSDN.

Step 2: I used the 'reseditor' to create a file named
"MyResources.resources" that contains only some string resources.

Step 3: I added this resource file to my existing test assembly (does
not
do
anything other than test the use of the string resources to generate
altername 'names' for enumerated values).

Step 4: In the class definition (for my form since that is all there is in this test code), I added "ResourceManager _Resources;".

Step 5: In the constructor for this form I added "_Resources = new
ResourceManager("MyResources", Assembly.GetExecutingAssembly());" (I
actually wrapped this in a try/catch block just in case, but the code does not cause an exception).

Step 6: In my code I generate the name of the resource string I want
and attempt to retrieve it: "result.Append("[Retrieved] " +
_Resources.GetString(resourceName));" -- I have checked that the name
I am passing is the name of one of the strings in the resource file.

Step 7: I get a MissingManifestResourceException reporting that it "Could not find any resources appropriate for the specified culture (or the

neutral
culture) in the given assembly."

Step 8: This fails for any string I attempt to read.

Step 9: If I examine the binary of the resource file (which is in the
assembly), the contents indicate that it is for the neutral culture.

What am I doing wrong?

-Ken



Nov 16 '05 #4

P: n/a
Yep, that did it. Basically this indicates that all of the MSDN examples are
wrong! One should use the following as the 'name' of the resource 'file'
that is embedded within the assembly:

_Resources = new
ResourceManager(Assembly.GetExceutingAssembly().Ge tName().Name +
".MyResources", Assembly.GetExecutingAssembly());

-Ken

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:Om**************@tk2msftngp13.phx.gbl...
.mresource public EnumerationNaming.MyResources.resources
{
}
This is the one you need. Therefore, you should change Step 5 to the
following:

_Resources = new ResourceManager("EnumerationNaming.MyResources",
Assembly.GetExecutingAssembly());

I really cannot explan why VS .NET appends the name of the namespace to

the name of the resource file itself,
it just works this way.
"Ken Allen" <ke******@sympatico.ca> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hmmm. Using ILDASM I can see the file names in the manifest, but it is not
listed in the assembly itself -- at the top level I see MANIFESZT and
"EnumerationNaming" (the name of my assembly/solution), and inside
"EnumerationNameing" all I see is Form1 and the publuc enum "MyStates",
which are all that were defined in the Form1.cs file! In the manifest I see
these lines:

.mresource public EnumerationNaming.MyResources.resources
{
}
.mresource public EnumerationNaming.Form1.resources
{
}

I added the reopsurce file by copying the MyResources.resources file to

the
same directory as the Form1.cs file and then performed an "Add

Existing..."
function to add the file -- and it appears in the solution explorer!

I do not understand!

-Ken

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote in message news:uU**************@TK2MSFTNGP12.phx.gbl...
Hello Ken,

Examine the assembly with the ILDASM tool to find out the real name of the resource file. It will most likely be prefixed with the default namespace name.
Therefore, on Step 5, you should specify the name of the resource file as:
"MyNamespace.MyResources"

"Ken Allen" <ke******@sympatico.ca> wrote in message
news:Oc*************@TK2MSFTNGP12.phx.gbl...
> OK, for a number of reasons I have needed to begin experimenting with > resources sooner than I had planned (I had avoided it for now).
>
> Step 1: I built the 'reseditor' application that is in the SDK
> sub-directory, as instructed by the MSDN.
>
> Step 2: I used the 'reseditor' to create a file named
> "MyResources.resources" that contains only some string resources.
>
> Step 3: I added this resource file to my existing test assembly (does not
do
> anything other than test the use of the string resources to generate
> altername 'names' for enumerated values).
>
> Step 4: In the class definition (for my form since that is all there is
in
> this test code), I added "ResourceManager _Resources;".
>
> Step 5: In the constructor for this form I added "_Resources = new
> ResourceManager("MyResources", Assembly.GetExecutingAssembly());" (I
> actually wrapped this in a try/catch block just in case, but the
code does
> not cause an exception).
>
> Step 6: In my code I generate the name of the resource string I want

and > attempt to retrieve it: "result.Append("[Retrieved] " +
> _Resources.GetString(resourceName));" -- I have checked that the

name I
am
> passing is the name of one of the strings in the resource file.
>
> Step 7: I get a MissingManifestResourceException reporting that it

"Could
> not find any resources appropriate for the specified culture (or the
neutral
> culture) in the given assembly."
>
> Step 8: This fails for any string I attempt to read.
>
> Step 9: If I examine the binary of the resource file (which is in

the > assembly), the contents indicate that it is for the neutral culture.
>
> What am I doing wrong?
>
> -Ken
>
>


Nov 16 '05 #5

P: n/a
As I noted, this resolved the problem, but now I am confused on how the
hierarchy of resource files work when one wishes to support more than one
language or dialect (e.g., culture). How do I use a single ResourceManage
that will search all cultures? Particularly, which constructor do I use? Do
I always reference the embedded resource file? Can I have more than one
embedded resource file? If so, how do I use them?

The information in MSDN is very sparse and, as I have discovered, very
misleading.

-Ken

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:Om**************@tk2msftngp13.phx.gbl...
.mresource public EnumerationNaming.MyResources.resources
{
}
This is the one you need. Therefore, you should change Step 5 to the
following:

_Resources = new ResourceManager("EnumerationNaming.MyResources",
Assembly.GetExecutingAssembly());

I really cannot explan why VS .NET appends the name of the namespace to

the name of the resource file itself,
it just works this way.
"Ken Allen" <ke******@sympatico.ca> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hmmm. Using ILDASM I can see the file names in the manifest, but it is not
listed in the assembly itself -- at the top level I see MANIFESZT and
"EnumerationNaming" (the name of my assembly/solution), and inside
"EnumerationNameing" all I see is Form1 and the publuc enum "MyStates",
which are all that were defined in the Form1.cs file! In the manifest I see
these lines:

.mresource public EnumerationNaming.MyResources.resources
{
}
.mresource public EnumerationNaming.Form1.resources
{
}

I added the reopsurce file by copying the MyResources.resources file to

the
same directory as the Form1.cs file and then performed an "Add

Existing..."
function to add the file -- and it appears in the solution explorer!

I do not understand!

-Ken

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote in message news:uU**************@TK2MSFTNGP12.phx.gbl...
Hello Ken,

Examine the assembly with the ILDASM tool to find out the real name of the resource file. It will most likely be prefixed with the default namespace name.
Therefore, on Step 5, you should specify the name of the resource file as:
"MyNamespace.MyResources"

"Ken Allen" <ke******@sympatico.ca> wrote in message
news:Oc*************@TK2MSFTNGP12.phx.gbl...
> OK, for a number of reasons I have needed to begin experimenting with > resources sooner than I had planned (I had avoided it for now).
>
> Step 1: I built the 'reseditor' application that is in the SDK
> sub-directory, as instructed by the MSDN.
>
> Step 2: I used the 'reseditor' to create a file named
> "MyResources.resources" that contains only some string resources.
>
> Step 3: I added this resource file to my existing test assembly (does not
do
> anything other than test the use of the string resources to generate
> altername 'names' for enumerated values).
>
> Step 4: In the class definition (for my form since that is all there is
in
> this test code), I added "ResourceManager _Resources;".
>
> Step 5: In the constructor for this form I added "_Resources = new
> ResourceManager("MyResources", Assembly.GetExecutingAssembly());" (I
> actually wrapped this in a try/catch block just in case, but the
code does
> not cause an exception).
>
> Step 6: In my code I generate the name of the resource string I want

and > attempt to retrieve it: "result.Append("[Retrieved] " +
> _Resources.GetString(resourceName));" -- I have checked that the

name I
am
> passing is the name of one of the strings in the resource file.
>
> Step 7: I get a MissingManifestResourceException reporting that it

"Could
> not find any resources appropriate for the specified culture (or the
neutral
> culture) in the given assembly."
>
> Step 8: This fails for any string I attempt to read.
>
> Step 9: If I examine the binary of the resource file (which is in

the > assembly), the contents indicate that it is for the neutral culture.
>
> What am I doing wrong?
>
> -Ken
>
>


Nov 16 '05 #6

P: n/a
Ken,

I would disagree. The MSDN docs on satellite assemblies and resource
fallback process are pretty consistent.
Take a look at the following:

http://msdn.microsoft.com/library/de...assemblies.asp
http://www.ondotnet.com/pub/a/dotnet.../14/local2.htm
http://msdn.microsoft.com/library/de...calization.asp
http://msdn.microsoft.com/library/de...gresources.asp
"Ken Allen" <ke******@sympatico.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
As I noted, this resolved the problem, but now I am confused on how the
hierarchy of resource files work when one wishes to support more than one
language or dialect (e.g., culture). How do I use a single ResourceManage
that will search all cultures? Particularly, which constructor do I use? Do I always reference the embedded resource file? Can I have more than one
embedded resource file? If so, how do I use them?

The information in MSDN is very sparse and, as I have discovered, very
misleading.

-Ken

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:Om**************@tk2msftngp13.phx.gbl...
.mresource public EnumerationNaming.MyResources.resources
{
}


This is the one you need. Therefore, you should change Step 5 to the
following:

_Resources = new ResourceManager("EnumerationNaming.MyResources",
Assembly.GetExecutingAssembly());

I really cannot explan why VS .NET appends the name of the namespace to

the
name of the resource file itself,
it just works this way.
"Ken Allen" <ke******@sympatico.ca> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hmmm. Using ILDASM I can see the file names in the manifest, but it is not listed in the assembly itself -- at the top level I see MANIFESZT and
"EnumerationNaming" (the name of my assembly/solution), and inside
"EnumerationNameing" all I see is Form1 and the publuc enum "MyStates", which are all that were defined in the Form1.cs file! In the manifest I
see
these lines:

.mresource public EnumerationNaming.MyResources.resources
{
}
.mresource public EnumerationNaming.Form1.resources
{
}

I added the reopsurce file by copying the MyResources.resources file
to
the
same directory as the Form1.cs file and then performed an "Add

Existing..."
function to add the file -- and it appears in the solution explorer!

I do not understand!

-Ken

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote in message news:uU**************@TK2MSFTNGP12.phx.gbl...
> Hello Ken,
>
> Examine the assembly with the ILDASM tool to find out the real name
of the
> resource file. It will most likely be prefixed with the default

namespace
> name.
> Therefore, on Step 5, you should specify the name of the resource
file as:
>
> "MyNamespace.MyResources"
>
> "Ken Allen" <ke******@sympatico.ca> wrote in message
> news:Oc*************@TK2MSFTNGP12.phx.gbl...
> > OK, for a number of reasons I have needed to begin experimenting with > > resources sooner than I had planned (I had avoided it for now).
> >
> > Step 1: I built the 'reseditor' application that is in the SDK
> > sub-directory, as instructed by the MSDN.
> >
> > Step 2: I used the 'reseditor' to create a file named
> > "MyResources.resources" that contains only some string resources.
> >
> > Step 3: I added this resource file to my existing test assembly (does not
> do
> > anything other than test the use of the string resources to
generate > > altername 'names' for enumerated values).
> >
> > Step 4: In the class definition (for my form since that is all there is
in
> > this test code), I added "ResourceManager _Resources;".
> >
> > Step 5: In the constructor for this form I added "_Resources = new
> > ResourceManager("MyResources", Assembly.GetExecutingAssembly());"
(I > > actually wrapped this in a try/catch block just in case, but the

code does
> > not cause an exception).
> >
> > Step 6: In my code I generate the name of the resource string I want and
> > attempt to retrieve it: "result.Append("[Retrieved] " +
> > _Resources.GetString(resourceName));" -- I have checked that the name
I
am
> > passing is the name of one of the strings in the resource file.
> >
> > Step 7: I get a MissingManifestResourceException reporting that it
"Could
> > not find any resources appropriate for the specified culture (or

the > neutral
> > culture) in the given assembly."
> >
> > Step 8: This fails for any string I attempt to read.
> >
> > Step 9: If I examine the binary of the resource file (which is in

the > > assembly), the contents indicate that it is for the neutral culture. > >
> > What am I doing wrong?
> >
> > -Ken
> >
> >
>



Nov 16 '05 #7

P: n/a
Perhaps the online MSDN is more accurate. I must confess that I have
depended mostly on the installed MSDN information since I cannot always
access the internet during development. The installed MSDN is terrible for
inaccuracies as these items are not as clearly addressed there.

-Ken

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:eR**************@tk2msftngp13.phx.gbl...
Ken,

I would disagree. The MSDN docs on satellite assemblies and resource
fallback process are pretty consistent.
Take a look at the following:

http://msdn.microsoft.com/library/de...assemblies.asp http://www.ondotnet.com/pub/a/dotnet.../14/local2.htm
http://msdn.microsoft.com/library/de...calization.asp http://msdn.microsoft.com/library/de...gresources.asp

"Ken Allen" <ke******@sympatico.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
As I noted, this resolved the problem, but now I am confused on how the
hierarchy of resource files work when one wishes to support more than one
language or dialect (e.g., culture). How do I use a single ResourceManage that will search all cultures? Particularly, which constructor do I use? Do
I always reference the embedded resource file? Can I have more than one
embedded resource file? If so, how do I use them?

The information in MSDN is very sparse and, as I have discovered, very
misleading.

-Ken

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote in message news:Om**************@tk2msftngp13.phx.gbl...
> .mresource public EnumerationNaming.MyResources.resources
> {
> }

This is the one you need. Therefore, you should change Step 5 to the
following:

_Resources = new ResourceManager("EnumerationNaming.MyResources",
Assembly.GetExecutingAssembly());

I really cannot explan why VS .NET appends the name of the namespace to
the
name of the resource file itself,
it just works this way.
"Ken Allen" <ke******@sympatico.ca> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
> Hmmm. Using ILDASM I can see the file names in the manifest, but it
is not
> listed in the assembly itself -- at the top level I see MANIFESZT
and > "EnumerationNaming" (the name of my assembly/solution), and inside
> "EnumerationNameing" all I see is Form1 and the publuc enum

"MyStates", > which are all that were defined in the Form1.cs file! In the manifest I
see
> these lines:
>
> .mresource public EnumerationNaming.MyResources.resources
> {
> }
> .mresource public EnumerationNaming.Form1.resources
> {
> }
>
> I added the reopsurce file by copying the MyResources.resources file to the
> same directory as the Form1.cs file and then performed an "Add
Existing..."
> function to add the file -- and it appears in the solution explorer!
>
> I do not understand!
>
> -Ken
>
> "Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
> in message news:uU**************@TK2MSFTNGP12.phx.gbl...
> > Hello Ken,
> >
> > Examine the assembly with the ILDASM tool to find out the real
name of the
> > resource file. It will most likely be prefixed with the default
namespace
> > name.
> > Therefore, on Step 5, you should specify the name of the resource file as:
> >
> > "MyNamespace.MyResources"
> >
> > "Ken Allen" <ke******@sympatico.ca> wrote in message
> > news:Oc*************@TK2MSFTNGP12.phx.gbl...
> > > OK, for a number of reasons I have needed to begin experimenting with
> > > resources sooner than I had planned (I had avoided it for now).
> > >
> > > Step 1: I built the 'reseditor' application that is in the SDK
> > > sub-directory, as instructed by the MSDN.
> > >
> > > Step 2: I used the 'reseditor' to create a file named
> > > "MyResources.resources" that contains only some string
resources. > > >
> > > Step 3: I added this resource file to my existing test assembly

(does
> not
> > do
> > > anything other than test the use of the string resources to

generate > > > altername 'names' for enumerated values).
> > >
> > > Step 4: In the class definition (for my form since that is all there is
> in
> > > this test code), I added "ResourceManager _Resources;".
> > >
> > > Step 5: In the constructor for this form I added "_Resources = new > > > ResourceManager("MyResources", Assembly.GetExecutingAssembly());" (I
> > > actually wrapped this in a try/catch block just in case, but the

code
> does
> > > not cause an exception).
> > >
> > > Step 6: In my code I generate the name of the resource string I want and
> > > attempt to retrieve it: "result.Append("[Retrieved] " +
> > > _Resources.GetString(resourceName));" -- I have checked that the

name
I
> am
> > > passing is the name of one of the strings in the resource file.
> > >
> > > Step 7: I get a MissingManifestResourceException reporting that
it > "Could
> > > not find any resources appropriate for the specified culture (or

the > > neutral
> > > culture) in the given assembly."
> > >
> > > Step 8: This fails for any string I attempt to read.
> > >
> > > Step 9: If I examine the binary of the resource file (which is
in the
> > > assembly), the contents indicate that it is for the neutral

culture. > > >
> > > What am I doing wrong?
> > >
> > > -Ken
> > >
> > >
> >
>
>


Nov 16 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.