Skip to content

Commit

Permalink
update service hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
afifi-ins committed Sep 11, 2024
1 parent 6d4fa39 commit ebc64f8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ protected override IList<Binding> GetBindings()
{
var bindings = new List<Binding>();
bindings.Add(GetNetTcpBinding());

#if !NET
if (!HostingEnvironment.IsHosted)
{
bindings.Add(GetNetNamedPipeBinding());
}

#endif
return bindings;
}

Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ protected override IList<Binding> GetBindings()
{
var bindings = new List<Binding>();
bindings.Add(GetNetTcpBinding());

#if !NET
if (!HostingEnvironment.IsHosted)
{
bindings.Add(GetNetNamedPipeBinding());
}

#endif
return bindings;
}

Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -31,3 +28,4 @@ public TestHostWebServiceHost(Type serviceType, params Uri[] baseAddresses)
}
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<IsPackable>false</IsPackable>
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
</PropertyGroup>

<ItemGroup>
<Using Include="System.Runtime.Serialization" />
<Using Include="Microsoft.Extensions.DependencyInjection.Extensions" />
Expand All @@ -32,11 +32,8 @@
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\ReliableSessionOneWayTestServiceHost.cs" />
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\ReliableSessionTestServiceHost.cs" />
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\Saml2IssuedTokenTestServiceHost.cs" />

<Compile Remove="..\IISHostedWcfService\App_code\testhosts\HttpsTransportSecurityMessageCredentialsCertTestServiceHost.cs" />
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\HttpsTransportSecurityMessageCredentialsUsernameTestServiceHost.cs" />
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\TcpDefaultResourceTestServiceHost.cs" />
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\TcpNoSecurityTestServiceHost.cs" />
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\TestHostWebServiceHost.cs" />

<None Include="..\IISHostedWcfService\App_code\testhosts\Federation\AcceptAnyUsernameSecurityTokenHandler.cs" />
Expand All @@ -47,11 +44,8 @@
<None Include="..\IISHostedWcfService\App_code\testhosts\ReliableSessionOneWayTestServiceHost.cs" />
<None Include="..\IISHostedWcfService\App_code\testhosts\ReliableSessionTestServiceHost.cs" />
<None Include="..\IISHostedWcfService\App_code\testhosts\Saml2IssuedTokenTestServiceHost.cs" />

<None Include="..\IISHostedWcfService\App_code\testhosts\HttpsTransportSecurityMessageCredentialsCertTestServiceHost.cs" />
<None Include="..\IISHostedWcfService\App_code\testhosts\HttpsTransportSecurityMessageCredentialsUsernameTestServiceHost.cs" />
<None Include="..\IISHostedWcfService\App_code\testhosts\TcpDefaultResourceTestServiceHost.cs" />
<None Include="..\IISHostedWcfService\App_code\testhosts\TcpNoSecurityTestServiceHost.cs" />
<None Include="..\IISHostedWcfService\App_code\testhosts\TestHostWebServiceHost.cs" />
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit ebc64f8

Please sign in to comment.