소스 검색

2009-09-17 Atsushi Enomoto <[email protected]>

	* WebScriptServiceHostFactory.cs : do tasks in previous change only
	  if it is done under ASP.NET environment.


svn path=/trunk/mcs/; revision=142127
Atsushi Eno 16 년 전
부모
커밋
4a4e0ecb23

+ 5 - 0
mcs/class/System.ServiceModel.Web/System.ServiceModel.Activation/ChangeLog

@@ -1,3 +1,8 @@
+2009-09-17  Atsushi Enomoto  <[email protected]>
+
+	* WebScriptServiceHostFactory.cs : do tasks in previous change only
+	  if it is done under ASP.NET environment.
+
 2009-09-04  Atsushi Enomoto  <[email protected]>
 
 	* WebScriptServiceHostFactory.cs : endpoints are automatically added

+ 5 - 3
mcs/class/System.ServiceModel.Web/System.ServiceModel.Activation/WebScriptServiceHostFactory.cs

@@ -62,9 +62,11 @@ namespace System.ServiceModel.Activation
 				if (Description.Endpoints.Count > 1)
 					throw new InvalidOperationException ("This service host factory does not allow custom endpoint configuration");
 
-				foreach (Type iface in Description.ServiceType.GetInterfaces ())
-					if (iface.GetCustomAttributes (typeof (ServiceContractAttribute), true).Length > 0)
-						AddServiceEndpoint (iface, new WebHttpBinding (), new Uri (String.Empty, UriKind.Relative));
+				if (ServiceHostingEnvironment.AspNetCompatibilityEnabled) {
+					foreach (Type iface in Description.ServiceType.GetInterfaces ())
+						if (iface.GetCustomAttributes (typeof (ServiceContractAttribute), true).Length > 0)
+							AddServiceEndpoint (iface, new WebHttpBinding (), new Uri (String.Empty, UriKind.Relative));
+				}
 			}
 
 			protected override void OnOpening ()