VirtualPathExtension Class
.NET Framework 3.0
Contains the service's virtual path when the service is hosted in Internet Information Services (IIS) or Windows Process Activation Service (WAS).
Namespace: System.ServiceModel.Activation
Assembly: System.ServiceModel (in system.servicemodel.dll)
Assembly: System.ServiceModel (in system.servicemodel.dll)
This extension is only present for services hosted in IIS or WAS. Services can determine whether they are hosted in IIS or WAS by retrieving this extension from their ServiceHostBase, as shown in the following example.
The following example shows how to recover the VirtualPathExtension from the service host and return a value that it is hosted in IIS or WAS.
bool isHosted = false;
ServiceHostBase host = OperationContext.Current.Host;
VirtualPathExtension vpe = host.Extentions.Find<VirtualPathExtension>();
if( vpe != null )
isHosted = true;
Console.WriteLine("Is the service hosted in IIS or WAS? {0}", isHosted);
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: