diff --git a/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/CoreWCF/NetHttpsBinding.cs b/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/CoreWCF/NetHttpsBinding.cs new file mode 100644 index 00000000000..567efb8ab0c --- /dev/null +++ b/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/CoreWCF/NetHttpsBinding.cs @@ -0,0 +1,45 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#if NET + +using CoreWCF; +using CoreWCF.Channels; + +namespace WcfService +{ + //public enum BasicHttpsSecurityMode + //{ + // // + // // Summary: + // // The Transport security mode. + // Transport, + // // + // // Summary: + // // The TransportWithMessageCredential security mode. + // TransportWithMessageCredential + //} + + // Cast BasicHttpsSecurityMode (WCF) to BasicHttpSecurityMode (CoreWCF) + //internal enum BasicHttpsSecurityMode + //{ + // None, + // Transport, + // Message, + // TransportWithMessageCredential, + // TransportCredentialOnly + //} + + internal class NetHttpsBinding : NetHttpBinding + { + public NetHttpsBinding() : base((BasicHttpSecurityMode)BasicHttpsSecurityMode.Transport) + { + } + + public NetHttpsBinding(BasicHttpsSecurityMode securityMode) : base((BasicHttpSecurityMode)securityMode) + { + } + } +} +#endif diff --git a/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TcpDefaultResourceTestServiceHost.cs b/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TcpDefaultResourceTestServiceHost.cs index f1d8a29fb9b..4584407bfe7 100644 --- a/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TcpDefaultResourceTestServiceHost.cs +++ b/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TcpDefaultResourceTestServiceHost.cs @@ -22,11 +22,13 @@ protected override IList GetBindings() { var bindings = new List(); bindings.Add(GetNetTcpBinding()); + +#if !NET if (!HostingEnvironment.IsHosted) { bindings.Add(GetNetNamedPipeBinding()); } - +#endif return bindings; } @@ -35,10 +37,12 @@ private Binding GetNetTcpBinding() return new NetTcpBinding() { Name = "tcp-default" }; } +#if !NET private Binding GetNetNamedPipeBinding() { return new NetNamedPipeBinding() { Name = "namedpipe-default" }; } +#endif public TcpDefaultResourceTestServiceHost(params Uri[] baseAddresses) : base(typeof(WcfService), baseAddresses) diff --git a/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TcpNoSecurityTestServiceHost.cs b/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TcpNoSecurityTestServiceHost.cs index 25c7860a45d..c6e2efaeb20 100644 --- a/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TcpNoSecurityTestServiceHost.cs +++ b/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TcpNoSecurityTestServiceHost.cs @@ -22,11 +22,13 @@ protected override IList GetBindings() { var bindings = new List(); bindings.Add(GetNetTcpBinding()); + +#if !NET if (!HostingEnvironment.IsHosted) { bindings.Add(GetNetNamedPipeBinding()); } - +#endif return bindings; } @@ -35,10 +37,12 @@ private Binding GetNetTcpBinding() return new NetTcpBinding(SecurityMode.None) { Name = "tcp-nosecurity" }; } +#if !NET private Binding GetNetNamedPipeBinding() { return new NetNamedPipeBinding(NetNamedPipeSecurityMode.None) { Name = "namedpipe-nosecurity" }; } +#endif public TcpNoSecurityTestServiceHost(params Uri[] baseAddresses) : base(typeof(WcfService), baseAddresses) diff --git a/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TestHostWebServiceHost.cs b/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TestHostWebServiceHost.cs index 585faba21e2..d4144a710e9 100644 --- a/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TestHostWebServiceHost.cs +++ b/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TestHostWebServiceHost.cs @@ -2,14 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if NET -using CoreWCF; -#else +#if !NET using System; using System.ServiceModel; using System.ServiceModel.Activation; using System.ServiceModel.Web; -#endif namespace WcfService { @@ -31,3 +28,4 @@ public TestHostWebServiceHost(Type serviceType, params Uri[] baseAddresses) } } } +#endif diff --git a/src/System.Private.ServiceModel/tools/SelfHostedCoreWcfService/SelfHostedCoreWCFService.csproj b/src/System.Private.ServiceModel/tools/SelfHostedCoreWcfService/SelfHostedCoreWCFService.csproj index 422f7a554ed..4444e1c34c2 100644 --- a/src/System.Private.ServiceModel/tools/SelfHostedCoreWcfService/SelfHostedCoreWCFService.csproj +++ b/src/System.Private.ServiceModel/tools/SelfHostedCoreWcfService/SelfHostedCoreWCFService.csproj @@ -5,17 +5,17 @@ false false - + - - - - - + + + + + @@ -24,52 +24,29 @@ - - - - - - - - - - - - + + - - - - - - + - - - - - - - - + + - -