Deploying Resource Files Separately...

G

Guest

In a project I am working on, it sounds like resource files are what I need
(to group things like error message strings).

If I put a resource file in a project, everything will work fine. However,
what I would like to be able to do is to put the resource files in a code
library of some sort (I am not sure if I am saying that correctly). From
reading some of the documentation (and some painful trial and error), I have
figured out how to make a public class with methods that expose the resources
(using the resgen and al utilities). Unfortunately, I have to compile these
components manually (which can be quite painful).

My question is whether or not there is a way to do this automatically in a
..NET project. The /publicClass switch is what does the trick but where would
I specify this switch in a project? Is it even possible? I have noticed
that the class I am expecting does get generated (or appears that way) but
all of the methods are marked as internal.

Any help will be most appreciated.

Thank you,

Jason Richmeier
 
S

Steven Cheng[MSFT]

Hi Jason,

Thank you for posting.

As for the VS 2005's built-in resx code generator, it does has the
limitation on the generated strong-type class's accessor. Currently, the
generated class is limited to internal only so that only the project
assembly itself or other friend assemblies can access the generated
resources. This is actually due to the consideration that such generated
resource are designed as local resource which will be used for internal
projects. For public strong-typed classes, we may still have to use the
commandline resgen tool.

BTW, I've found an code project article which has mentioned a 3rd party
extended resx generator custom tool which can help build public
strong-typed resource access class:

#Extended Strongly Typed Resource Generator
http://www.codeproject.com/useritems/ResXFileCodeGeneratorEx.asp?print=true

Hope this helps some.

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.)
 

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