This documentation is archived and is not being maintained.

ServiceModel Registration Tool (ServiceModelReg.exe)

This command-line tool provides the ability to manage the registration of ServiceModel on a single machine.

ServiceModelReg.exe [-i[r | ru] | -u | -ua | -r | -s:<path> | -sn:<path> | -k:<path> | -kn:<path> | -lv | -lk | -vi] [-q | -v] [-nologo] [-?]

The tool can be found in the following location:

%SystemRoot%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\

When the ServiceModel Registration Tool is run on Windows Vista, the Windows Features dialog may not reflect that the Windows Communication Foundation HTTP Activation option under Microsoft .NET Framework 3.0 is turned on. The Windows Features dialog can be accessed by clicking Start, then click Run and then typing OptionalFeatures.

The following tables describe the options that can be used with ServiceModelReg.exe.

Option Description


Registers this version of WCF and update scriptmaps at the Internet Information Services (IIS) metabase root and for all scriptmaps under the root. Existing scriptmaps of lower versions are upgraded to this version.


Registers this version of WCF, register only. Does not install WCF scriptmaps in IIS.


Registers this version of WCF. If there are any existing applications that use WCF, do not update their scriptmaps in IIS.


Un-registers this version of WCF. Existing scriptmaps to this version are remapped to highest remaining version of WCF installed on the machine.


Un-registers all versions of WCF on the machine.


Re-registers this version of WCF and updates scriptmaps at the IIS metabase root and for all scriptmaps under the root. Existing scriptmaps are upgraded to this version regardless of the original versions.


Registers scriptmaps for this version of WCF at the specified path, recursively.


Registers scriptmaps for this version of WCF at the specified path, non-recursively.


Removes all scriptmaps to any version of WCF from the specified path, recursively.


Removes all scriptmaps to any version WCF from the specified path, non-recursively.


Lists all versions of WCF that are registered on the machine, with status and installation path.


Lists the paths of all IIS metabase keys where WCF is scriptmapped, together with the version. Keys that inherit WCF scriptmaps from a parent key are not displayed.


Verifies the installation of target components and generates a report. Components can be in the following states: unknown, not installed, installed default, or installed custom.


Do not ask for confirmation before registering or re-registering components.


Quiet mode (reduced output).


Verbose mode.


Suppresses the copyright and banner message.

Fixing the FileLoadException Error

If you installed previous versions of WCF on your machine, you may get a FileLoadFoundException error when you run the ServiceModelReg tool to register a new installation. This can happen even if you have manually removed files from the previous install, but left the machine.config settings intact.

The error message is similar to the following.

Error: System.IO.FileLoadException: Could not load file or assembly 'System.ServiceModel, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'System.ServiceModel, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'

You should note from the error message that the System.ServiceModel Version assembly was installed by an early Customer Technology Preview (CTP) release. The current version of the System.ServiceModel assembly released is instead. Therefore, this issue is encountered when you want to install the official WCF release on a machine where an early CTP release of WCF was installed, but not completely uninstalled.

ServiceModelReg.exe cannot clean up prior version entries, nor can it register the new version's entries. The only workaround is to manually edit machine.config. You can locate this file at the following location.


If you are running WCF on a 64-bit machine, you should also edit the same file at this location.


Locate any XML nodes in this file that refer to “System.ServiceModel, Version=”, delete them and any child nodes. Save the file and re-run ServiceModelReg.exe resolves this problem.

The following examples show how to use the -s and -k options of the ServiceModelReg.exe tool.

ServiceModelReg.exe -s:W3SVC/1/ROOT/SampleApp1
ServiceModelReg.exe -k:W3SVC/1/ROOT/SampleApp1

© 2007 Microsoft Corporation. All rights reserved.