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

Option

Description

-i

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.

-ir

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

-iru

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

-u

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

-ua

Un-registers all versions of WCF on the machine.

-r

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.

-s:<path>

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

-sn:<path>

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

-k:<path>

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

-kn:<path>

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

-lv

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

-lk

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.

-vi

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.

-y

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

If you have 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.

Error: System.IO.FileLoadException: Could not load file or assembly 'System.ServiceModel, Version=2.0.0.0, 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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

You should note from the error message that the System.ServiceModel Version 2.0.0.0 assembly was installed by an early CTP (Customer Technology Preview) release. The current version of the System.ServiceModel assembly released is 3.0.0.0 instead. Therefore, you will encounter this issue 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.

%windir%\Microsoft.NET\Framework\v2.0.50727\config\machine.config

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

%windir%\Microsoft.NET\Framework64\v2.0.50727\config\machine.config

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