Using MessageManager
If you are using the MessageManager object to manage localized message handling through the rc.xml file, you use the RCXml2Resx tool (located in the Commerce Server 2002 folder) to convert your rc.xml file to .resx files, and then create satellite assemblies for the MessageManager object using the .resx files. Commerce Server uses satellite assemblies to store language-dependent string resources.
To implement message management, do the following:
- Convert rc.xml files to .resx files by using the RCXml2Resx tool.
- Convert .resx files to resource files by using the Microsoft .NET Resource Generator (ResGen) tool.
- Generate satellite assemblies by using the Microsoft Assembly Linker (Al.exe) tool.
- Obtain the base name for your satellite assemblies.
- Edit the web.config file to modify the messageManager tag to include information about the satellite assemblies.
Note
- You can also generate satellite assemblies by using the Visual Studio .NET integrated development environment (IDE). If choose to use the Visual Studio .NET IDE, you can skip steps 2 and 3. For information about how to use the Visual Studio .NET IDE to build satellite assemblies, see To build satellite assemblies using Visual Studio .NET.
To convert rc.xml files to .resx files
To convert .resx files to resource files
To create satellite assemblies
To build satellite assemblies using Visual Studio .NET
To obtain the base name for your satellite assemblies
To edit the web.config file
To convert rc.xml files to .resx files
Click Start, point to Programs, point to Microsoft Visual Studio .NET, point to Visual Studio .NET Tools, and then click Visual Studio .NET Command Prompt.
In the Visual Studio .NET Command Prompt window, type RCXml2Resx <XMLFilePath> <outputfilename[.ext]>.
For example, RCXml2Resx c:\rc.xml c:\rc.resx will convert the rc.xml file located on C:\ to a new rc.resx file and place it on C:\.
Notes
- The RCXml2Resx tool generates one .resx file for each language in the XML file.
- If outputfilename is not specified then it will be the same as the name of the XML file.
- If .ext is not specified then the default extension will be .resx.
To convert .resx files to resource files
- Click Start, point to Programs, point to Microsoft Visual Studio .NET, point to Visual Studio .NET Tools, and then click Visual Studio .NET Command Prompt.
- In the Visual Studio .NET Command Prompt window, type ResGen <inputFile.ext> [<outputFile.ext>].
To create satellite assemblies
Click Start, point to Programs, point to Microsoft Visual Studio .NET, point to Visual Studio .NET Tools, and then click Visual Studio .NET Command Prompt.
In the Visual Studio .NET Command Prompt window, type al /embed:<Resource> /culture:<culture name> /out:<filename>
For example, al /embed:MessageManagerResources.en-US.resources /culture:en-US /out:C:\inetpub\wwwroot\CommerceWebApplication\bin\en-us\CommerceWebApplication.resources.dll will create the satellite assembly for the En-US culture for the MessageManagerResource.en-US resource.
To build satellite assemblies using Visual Studio .NET
- Copy the .resx files (from the first procedure) to your Commerce Server Project directory.
- Start Visual Studio .NET and open your Commerce Project.
- On the toolbar, click File, and then click Add Existing Items.
- In the Add Existing Item - <Project Name> dialog box, select the .resx files you copied in step 1, and then click Open.
- On the toolbar, click Build, and then click Build Solution.
Visual Studio .NET will generate the satellite assemblies for you.
To obtain the base name for your satellite assemblies
Notes
- If you are building the satellite assemblies by using the Microsoft Assembly Linker, then the base name will be the name of your resource file. For example, if you created a resource file named MessageManagerResources.en-US.resources, then the base name will be MessageManagerResources.
- If you are using Visual Studio .NET to build your satellite assemblies, then follow these steps to get the base name.
Click Start, point to Programs, point to Microsoft Visual Studio .NET, point to Visual Studio .NET Tools, and then click Visual Studio .NET Command Prompt.
In the Visual Studio .NET Command Prompt window, type ildasm <satellite assembly>.resources.dll
Click MANIFEST.
You will see a section that looks like .mresource public 'BaseName.en-US.resources'.
For example, if you see the section 'CommerceWebApplication.MessageManagerResources.en-US.resources', then CommerceWebApplication.MessageManagerResources is the base name for your satellite assembly, and you must use this to edit the web.config file.
To edit the web.config file
Open the web.config file and go to the messageManager tag.
In the messageManager tag, do the following:
<messageManager> <cultures default="<type default culture name>" BaseName="<Type the Resource Name. See To obtain the base name for your Satellite Assemblies>" assembly="<Name of the Satellite Assembly containing your resources>"> <culture id="<Your Culture ID 1>" /> <culture id="<Your Culture ID 2>" /> . . <culture id="<Your Culture ID N>" /> </cultures> <resources> <resource id="<Your Resource ID" /> </resources> </messageManager>
Your message management system will now use the Commerce Server .NET Application Framework.
See Also
An Example Using MessageManager
Copyright © 2005 Microsoft Corporation.
All rights reserved.