Re: How to use .RESX or .RESOURCE to retrieve list of strings

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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 -


.



Relevant Pages

  • Re: How to use .RESX or .RESOURCE to retrieve list of strings
    ... Web applications, not web services, or not 2005 web services. ... MyApplication is the name of the resource that resides in the DLL. ... same DLL as the resources. ... A possibly easier method is to add a Resource RESX file to your DLL ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: How to use .RESX or .RESOURCE to retrieve list of strings
    ... reading about the different flavors of web services that can be ... This project does not create a DLL ... Can I still use resources from a .RESX file in this scenario? ... also a designer file such as Resource1.Designer.cs. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: How to make the web services client without using Add Web Reference Dialogue boxes
    ... Now if the DLL uses the config files/ resources you ... During the deployment only I will come to know the web services path. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: #pragma lib buggers everything up
    ... A lot of the resources are relevant to the static ... a client exe, and I experienced these too, i.e. the exe can't use any ... Have a resource-only DLL, you might say, - yes, I did consider this but the ... > and often on a particular version of the compiler and particular compiler ...
    (microsoft.public.vc.language)
  • Re: Localization of my MFC application
    ... We create a set of resource files for each separate program (.EXE, .DLL, ... My resources are not so large that it makes a big ... > We have an application which has an exe and uses two MFC extension DLLs ...
    (microsoft.public.vc.mfc)