Re: How to use .RESX or .RESOURCE to retrieve list of strings
- From: nws_reader@xxxxxxxxx
- Date: Wed, 22 Aug 2007 08:48:31 -0700
Thanks again for your response. It looks like I need to do more
reading about the different flavors of web services that can be
created with VS 2005 (I'm a newbie).
I created a project using "File, New, Web Site ..." and chose the
"ASP .NET Web Service" template. This project does not create a DLL
as opposed to using "File, New, Project ...". However, I'm able to
deploy it to the 2003 server and have an application add a reference
to it and use it. The deploying process is done by copying the .asmx
and web.config file and other files in the App_Code folder.
Can I still use resources from a .RESX file in this scenario?
MyApplication is the name of the resource that resides in the DLL.
For a DLL, not sure about using Assembly.GetExecutingAssembly(),
another alternative is to use a object type that is defined in the
same DLL as the resources. e.g.
ResourceManager rm = new ResourceManager("MyApplication.res",
typeof(objectInDll).Assembly)
I sometimes create a wrapper object around the resources and place it
in the same DLL, and actually use it as the object in the 'typeof'.
A possibly easier method is to add a Resource RESX file to your DLL
project. This will create a resx file such as Resource1.resx, and
also a designer file such as Resource1.Designer.cs. Add some strings
to the RESX file via the Designer, and then if you right click on the
designer file and click on Code, you will see a generated class that
provides a wrapper and accessors for the strings that you have added.
This should hopefully serve as an example also.
Ron- Hide quoted text -
- Show quoted text -
.
- Follow-Ups:
- Re: How to use .RESX or .RESOURCE to retrieve list of strings
- From: ronscottlangham
- Re: How to use .RESX or .RESOURCE to retrieve list of strings
- References:
- How to use .RESX or .RESOURCE to retrieve list of strings
- From: nws_reader
- Re: How to use .RESX or .RESOURCE to retrieve list of strings
- From: nws_reader
- Re: How to use .RESX or .RESOURCE to retrieve list of strings
- From: ronscottlangham
- Re: How to use .RESX or .RESOURCE to retrieve list of strings
- From: nws_reader
- Re: How to use .RESX or .RESOURCE to retrieve list of strings
- From: ronscottlangham
- How to use .RESX or .RESOURCE to retrieve list of strings
- Prev by Date: Re: Change WCF client endpoint address
- Next by Date: Re: How to use .RESX or .RESOURCE to retrieve list of strings
- Previous by thread: Re: How to use .RESX or .RESOURCE to retrieve list of strings
- Next by thread: Re: How to use .RESX or .RESOURCE to retrieve list of strings
- Index(es):
Relevant Pages
|