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

statelite resource assembly

P: n/a
I'm having a real hard-time to work out the hell of the statelite
assembly.

1) At start,
the official MSDN stated to use:

.... new ResourceManager(strBaseName, Assembly.GetExecutingAssembly());
and the resource file should be named as <basename>.[culture.]resx

It didn't work (in WinApp).
2) Do some reseach, figured out should be:
.... new ResourceManager(strAssembly+BaseName,
Assembly.GetExecutingAssembly());

OK, got it work in WinApp.
3) Then attempt port to WebApp ASP.NET. Create a class assembly that
manage this task. And the hell, nothing work, either using the #2
findout or the MSDN.
Just keep on getting "Could not find any resources..." so and so.
Does anyone know what specifically need to be work out for WebApp?
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

Kelmen, you might be interested in my two articles about creating
multilingual websites, which provide an alternative to those satellite
assemblies:
http://openmymind.net/localization/index.html
http://openmymind.net/localization/index2.html
Also, is the error message saying anything about "appropriate for the
specified culture (or the neutral culture)". If so, the problem isn't with
the base name, the problem is that ASP.Net is running in a culture which you
don't have a resource file for. Consider creating a default resource file
(resource.resx instead of resource.en-CA.resx) for your project.

Finally, you should simply create your resource via:

new ResourceManager(ProjectNameSpace.ResourceFileName,
Assembly.GetExecutingAssembly());

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Kelmen Wong" <ke****@hotmail.com> wrote in message
news:84**************************@posting.google.c om...
I'm having a real hard-time to work out the hell of the statelite
assembly.

1) At start,
the official MSDN stated to use:

... new ResourceManager(strBaseName, Assembly.GetExecutingAssembly());
and the resource file should be named as <basename>.[culture.]resx

It didn't work (in WinApp).
2) Do some reseach, figured out should be:
... new ResourceManager(strAssembly+BaseName,
Assembly.GetExecutingAssembly());

OK, got it work in WinApp.
3) Then attempt port to WebApp ASP.NET. Create a class assembly that
manage this task. And the hell, nothing work, either using the #2
findout or the MSDN.
Just keep on getting "Could not find any resources..." so and so.
Does anyone know what specifically need to be work out for WebApp?

Nov 18 '05 #2

P: n/a
Hello Karl, thanks for the help.

I managed to get it work as per your advise.

After review the code, I believe the proper way when instancing the
ResourceManager, the basename should be NameSpace.BaseName.

The initial findout about using ProjectName.BaseName is quite
misleading, as most WinApp we created for testing purposes will have
its namespace defaulted as the project name. It work in WinApp because
we actually using NameSpace.BaseName instead of the project name.
:)

---

I read your articles, they are very good one. But I have a question in
part 1.

You mentioned "every time the translation department wanted to change
some text, we'd need to recompile the entire application". If we adopt
the satelite assemblies approach, although we may need to recompile
the project, isn't that we only need to deploy only the satelite
assembly?

In my design, I attempt to approach the culture in 2 parts: 1 is the
core engine (the typically data-access-layer components) will adopt
the satelite approach, to store the (error) messages only used by
them. As these shouldn't subject to frequent changes.
The 2nd is the BLL (business-logic-layer, the so-called biz obj) which
will adopt the db approach, as those text will likely subject to
end-user constant maintenance.

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:<eh**************@TK2MSFTNGP12.phx.gbl>...
Kelmen, you might be interested in my two articles about creating
multilingual websites, which provide an alternative to those satellite
assemblies:
http://openmymind.net/localization/index.html
http://openmymind.net/localization/index2.html
Also, is the error message saying anything about "appropriate for the
specified culture (or the neutral culture)". If so, the problem isn't with
the base name, the problem is that ASP.Net is running in a culture which you
don't have a resource file for. Consider creating a default resource file
(resource.resx instead of resource.en-CA.resx) for your project.

Finally, you should simply create your resource via:

new ResourceManager(ProjectNameSpace.ResourceFileName,
Assembly.GetExecutingAssembly());

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/

Nov 18 '05 #3

P: n/a
About your question re recompilation and satelite assemblies, the situation
we were in was to use a default culture - which gets compiled into the
primary assembly. In retrospect, while having a default assembly is nice,
it's not worth the trouble (since it restarts the webapp). As you point
out, if you only have satelite assemblies it isn't as big a problem (still a
pita to have to recompile).

ASP.Net 2.0 will have nicer built-in support..yay!

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Kelmen Wong" <ke****@hotmail.com> wrote in message
news:84**************************@posting.google.c om...
Hello Karl, thanks for the help.

I managed to get it work as per your advise.

After review the code, I believe the proper way when instancing the
ResourceManager, the basename should be NameSpace.BaseName.

The initial findout about using ProjectName.BaseName is quite
misleading, as most WinApp we created for testing purposes will have
its namespace defaulted as the project name. It work in WinApp because
we actually using NameSpace.BaseName instead of the project name.
:)

---

I read your articles, they are very good one. But I have a question in
part 1.

You mentioned "every time the translation department wanted to change
some text, we'd need to recompile the entire application". If we adopt
the satelite assemblies approach, although we may need to recompile
the project, isn't that we only need to deploy only the satelite
assembly?

In my design, I attempt to approach the culture in 2 parts: 1 is the
core engine (the typically data-access-layer components) will adopt
the satelite approach, to store the (error) messages only used by
them. As these shouldn't subject to frequent changes.
The 2nd is the BLL (business-logic-layer, the so-called biz obj) which
will adopt the db approach, as those text will likely subject to
end-user constant maintenance.

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>

wrote in message news:<eh**************@TK2MSFTNGP12.phx.gbl>...
Kelmen, you might be interested in my two articles about creating
multilingual websites, which provide an alternative to those satellite
assemblies:
http://openmymind.net/localization/index.html
http://openmymind.net/localization/index2.html
Also, is the error message saying anything about "appropriate for the
specified culture (or the neutral culture)". If so, the problem isn't with the base name, the problem is that ASP.Net is running in a culture which you don't have a resource file for. Consider creating a default resource file (resource.resx instead of resource.en-CA.resx) for your project.

Finally, you should simply create your resource via:

new ResourceManager(ProjectNameSpace.ResourceFileName,
Assembly.GetExecutingAssembly());

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.