Managed Resources Sample

Sample Overview

This sample demonstrates the use of managed resources. It allows the user to experiment with various options in creating and using managed resources and resource assemblies.

The following table shows the command-line options used by the sample.

OptionDescription
/?
-?
/h
-h
Displays usage description.
/r
-r
Uses the ResourceManager class to build .resource files and then invokes the Assembly Linker to build satellite assemblies in the correct location to be found and loaded by the application when the /u option is used.
/t
-t
Emits text resource files and usage instructions on how to manually perform the steps required to generate .resources files using the Resource Generator tool, and satellite assemblies using the Assembly Linker.
/u
-u
Causes the application to use the resource file build automatically with the /r option or manually after using the /t option.

Use /r first to build satellite assemblies and then use /u to see the results of using the various satellite assemblies. Or use /t to emit text files and then manually build .resources files and satellite assemblies.  Use /u to see the results of using the various satellite assemblies.

Sample Source and Build Output Locations

The sample source is found in \rotor\samples\howto\resources. 

The source file is:

The build output location is %TARGETCOMPLUS%\samples\howto\resources.  The output file is an executable assembly named managedresources.exe.

Building the Sample

All samples are built from the buildall script. 

You can also build all the samples by switching to the root of the sample directory, sscli\samples, and typing build -c.

You can build this specific sample by switching to the sample directory and typing build -c.

Running the Sample

These steps require that the Shared Source CLI (SSCLI) be already built and functional.

  1. Run env.bat or source the env.csh or env.sh script files depending on your platform.
  2. Switch to the %TARGETCOMPLUS%\samples\howto\resources directory.
  3. Type the following command:

    clix managedresources.exe option


Copyright (c) 2002 Microsoft Corporation. All rights reserved.