Error Provider::TranslateUserError

Translates a user-specified error to another error, which is useful when you know the specific error you want to raise. Mainly used for localization. Used by Microsoft Provisioning Framework (MPF).

To remap errors with this procedure, create a separate XML lookup file for every language. The directory Microsoft Provisioning\Samples\SampleWebSite\StringCache\1033 (usually a subdirectory of Program Files) contains a template file, default_errors.xml. Alternately, you can use the format from the following example, which is excerpted from this file.

  <Item name="adduser|0x82101391">
	<message>Sample error message.</message>
  <Item name="createorg|0x82101001">
	<message>Another sample error message.</message>

Each Item node corresponds to one entry in the file. The name attribute expects data in the format error message context|source error code. The message and errorCode child nodes specify the translated error description and code, respectively. The message node can be an arbitrary string. The errorCode node specifies an HRESULT in either hexadecimal (0xFFFFFFFF) or decimal (+-9999999999) format.

After creating the new file, register it in the \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning\Providers\Error Provider\RootFolder key.


When implementing the file, it is advisable to change the file name, file location, and registry key name to ones that are more meaningful and secure.

 Schema Definition
 Sample Code
 Applies To
 See Also