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

Home Posts Topics Members FAQ

Problem with Resources

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.re sources" 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 "ResourceManage r _Resources;".

Step 5: In the constructor for this form I added "_Resources = new
ResourceManager ("MyResource s", Assembly.GetExe cutingAssembly( ));" (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.GetS tring(resourceN ame));" -- 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 MissingManifest ResourceExcepti on 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
7 1756
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.My Resources"

"Ken Allen" <ke******@sympa tico.ca> wrote in message
news:Oc******** *****@TK2MSFTNG P12.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.re sources" 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 "ResourceManage r _Resources;".

Step 5: In the constructor for this form I added "_Resources = new
ResourceManager ("MyResource s", Assembly.GetExe cutingAssembly( ));" (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.GetS tring(resourceN ame));" -- 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 MissingManifest ResourceExcepti on 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
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
"EnumerationNam ing" (the name of my assembly/solution), and inside
"EnumerationNam eing" 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 EnumerationNami ng.MyResources. resources
{
}
..mresource public EnumerationNami ng.Form1.resour ces
{
}

I added the reopsurce file by copying the MyResources.res ources 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.c om> wrote
in message news:uU******** ******@TK2MSFTN GP12.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.My Resources"

"Ken Allen" <ke******@sympa tico.ca> wrote in message
news:Oc******** *****@TK2MSFTNG P12.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.re sources" 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 "ResourceManage r _Resources;".

Step 5: In the constructor for this form I added "_Resources = new
ResourceManager ("MyResource s", Assembly.GetExe cutingAssembly( ));" (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.GetS tring(resourceN ame));" -- 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 MissingManifest ResourceExcepti on 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
> .mresource public EnumerationNami ng.MyResources. resources
{
}
This is the one you need. Therefore, you should change Step 5 to the
following:

_Resources = new ResourceManager ("EnumerationNa ming.MyResource s",
Assembly.GetExe cutingAssembly( ));

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******@sympa tico.ca> wrote in message
news:%2******** *******@TK2MSFT NGP11.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
"EnumerationNam ing" (the name of my assembly/solution), and inside
"EnumerationNam eing" 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 EnumerationNami ng.MyResources. resources
{
}
.mresource public EnumerationNami ng.Form1.resour ces
{
}

I added the reopsurce file by copying the MyResources.res ources 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.c om> wrote
in message news:uU******** ******@TK2MSFTN GP12.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.My Resources"

"Ken Allen" <ke******@sympa tico.ca> wrote in message
news:Oc******** *****@TK2MSFTNG P12.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.re sources" 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 "ResourceManage r _Resources;".

Step 5: In the constructor for this form I added "_Resources = new
ResourceManager ("MyResource s", Assembly.GetExe cutingAssembly( ));" (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.GetS tring(resourceN ame));" -- 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 MissingManifest ResourceExcepti on 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
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.GetEx ceutingAssembly ().GetName().Na me +
".MyResourc es", Assembly.GetExe cutingAssembly( ));

-Ken

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

_Resources = new ResourceManager ("EnumerationNa ming.MyResource s",
Assembly.GetExe cutingAssembly( ));

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******@sympa tico.ca> wrote in message
news:%2******** *******@TK2MSFT NGP11.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
"EnumerationNam ing" (the name of my assembly/solution), and inside
"EnumerationNam eing" 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 EnumerationNami ng.MyResources. resources
{
}
.mresource public EnumerationNami ng.Form1.resour ces
{
}

I added the reopsurce file by copying the MyResources.res ources 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.c om> wrote in message news:uU******** ******@TK2MSFTN GP12.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.My Resources"

"Ken Allen" <ke******@sympa tico.ca> wrote in message
news:Oc******** *****@TK2MSFTNG P12.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.re sources" 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 "ResourceManage r _Resources;".
>
> Step 5: In the constructor for this form I added "_Resources = new
> ResourceManager ("MyResource s", Assembly.GetExe cutingAssembly( ));" (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.GetS tring(resourceN ame));" -- 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 MissingManifest ResourceExcepti on 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
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.c om> wrote
in message news:Om******** ******@tk2msftn gp13.phx.gbl...
.mresource public EnumerationNami ng.MyResources. resources
{
}
This is the one you need. Therefore, you should change Step 5 to the
following:

_Resources = new ResourceManager ("EnumerationNa ming.MyResource s",
Assembly.GetExe cutingAssembly( ));

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******@sympa tico.ca> wrote in message
news:%2******** *******@TK2MSFT NGP11.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
"EnumerationNam ing" (the name of my assembly/solution), and inside
"EnumerationNam eing" 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 EnumerationNami ng.MyResources. resources
{
}
.mresource public EnumerationNami ng.Form1.resour ces
{
}

I added the reopsurce file by copying the MyResources.res ources 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.c om> wrote in message news:uU******** ******@TK2MSFTN GP12.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.My Resources"

"Ken Allen" <ke******@sympa tico.ca> wrote in message
news:Oc******** *****@TK2MSFTNG P12.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.re sources" 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 "ResourceManage r _Resources;".
>
> Step 5: In the constructor for this form I added "_Resources = new
> ResourceManager ("MyResource s", Assembly.GetExe cutingAssembly( ));" (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.GetS tring(resourceN ame));" -- 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 MissingManifest ResourceExcepti on 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
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******@sympa tico.ca> wrote in message
news:%2******** ********@TK2MSF TNGP09.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.c om> wrote
in message news:Om******** ******@tk2msftn gp13.phx.gbl...
.mresource public EnumerationNami ng.MyResources. resources
{
}


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

_Resources = new ResourceManager ("EnumerationNa ming.MyResource s",
Assembly.GetExe cutingAssembly( ));

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******@sympa tico.ca> wrote in message
news:%2******** *******@TK2MSFT NGP11.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
"EnumerationNam ing" (the name of my assembly/solution), and inside
"EnumerationNam eing" 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 EnumerationNami ng.MyResources. resources
{
}
.mresource public EnumerationNami ng.Form1.resour ces
{
}

I added the reopsurce file by copying the MyResources.res ources 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.c om> wrote in message news:uU******** ******@TK2MSFTN GP12.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.My Resources"
>
> "Ken Allen" <ke******@sympa tico.ca> wrote in message
> news:Oc******** *****@TK2MSFTNG P12.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.re sources" 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 "ResourceManage r _Resources;".
> >
> > Step 5: In the constructor for this form I added "_Resources = new
> > ResourceManager ("MyResource s", Assembly.GetExe cutingAssembly( ));"
(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.GetS tring(resourceN ame));" -- 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 MissingManifest ResourceExcepti on 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
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.c om> wrote
in message news:eR******** ******@tk2msftn gp13.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******@sympa tico.ca> wrote in message
news:%2******** ********@TK2MSF TNGP09.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.c om> wrote in message news:Om******** ******@tk2msftn gp13.phx.gbl...
> .mresource public EnumerationNami ng.MyResources. resources
> {
> }

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

_Resources = new ResourceManager ("EnumerationNa ming.MyResource s",
Assembly.GetExe cutingAssembly( ));

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******@sympa tico.ca> wrote in message
news:%2******** *******@TK2MSFT NGP11.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 > "EnumerationNam ing" (the name of my assembly/solution), and inside
> "EnumerationNam eing" 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 EnumerationNami ng.MyResources. resources
> {
> }
> .mresource public EnumerationNami ng.Form1.resour ces
> {
> }
>
> I added the reopsurce file by copying the MyResources.res ources 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.c om> wrote
> in message news:uU******** ******@TK2MSFTN GP12.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.My Resources"
> >
> > "Ken Allen" <ke******@sympa tico.ca> wrote in message
> > news:Oc******** *****@TK2MSFTNG P12.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.re sources" 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 "ResourceManage r _Resources;".
> > >
> > > Step 5: In the constructor for this form I added "_Resources = new > > > ResourceManager ("MyResource s", Assembly.GetExe cutingAssembly( ));" (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.GetS tring(resourceN ame));" -- 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 MissingManifest ResourceExcepti on 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1172
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...
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
4877
by: Ian | last post by:
Hi there, I need some help if anyone can jump in, i know its something easy but i am just going round in circles. I was following a tutorial here (http://www.codeproject.com/dotnet/Localization.asp) to use localization, I have created a resource file (.resource) but everytime i try and compile I get the error below.
1
1421
by: Gianmaria I. | last post by:
Hi, i've got a problem woth localized assembly resources. My app namespace is GM, and i heve 3 languages.. en as default, it and es. So i've created 3 text resources called: Messages.txt Messages.it.txt Messages.es.txt
4
2628
by: Arif Çimen | last post by:
Hi to everybody, I have chnged a button text in design mode. But After compiling and executing the program the text of the button do not change to new value. Any Ideas? Thaks for helps.
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...;-)):
0
2017
by: Kleanthis | last post by:
I have a problem, when deploying multilingual applications using cab files on Compact Framework 2.0. It seems that something is going wrong with compact framework 2.0 Below I have a description of the problem The main Smart Device Application contains 3 resource files under the Properties folder, in order to produce localization satellite asseblies. Those resource files are named Resources.resx (a default empty resource file),...
0
1764
by: Fabrice | last post by:
Hello, (Alain) Tis is a part of my code to retrieve text from hastable in memory cache, by reading (befor) a resources file. Thanks for your help. /1/ The resources file * I have create a .TXT file with Keys/Values
1
2569
by: Nathan | last post by:
We have a project that contains a number of DLLs. One DLL is a library containing User Interface utilities that are used in most of our forms. As we plan to localize all our strings, we've added a project that contains only string resources. The structure in solution explorer looks like: Utilities (Project) -- UtilityA.cs -- UtilityB.cs Utilities_en (Project) -- ResourceA.en.resx
0
9273
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
10032
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
9872
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
9841
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
8712
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...
0
6534
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();...
0
5141
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3805
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
3358
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.