Skip to content

Update WCF sample Instance Pooling code to conditionally support .NET framework / Core #6309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -7,4 +7,4 @@
<endpoint address="net.tcp://localhost:8001/" binding="netTcpBinding" contract="Microsoft.ServiceModel.Samples.IDoWork" name="ObjectPooledWorkService"/>
</client>
</system.serviceModel>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.

using System;
using System.ServiceModel.Channels;
using System.ServiceModel;
using System.Diagnostics;

@@ -29,8 +28,14 @@ static void Main(string[] args)
}

static void CallWorkService()
{
{
#if NET6_0_OR_GREATER
NetTcpBinding binding = new NetTcpBinding();
EndpointAddress endpointAddress = new EndpointAddress(new Uri("net.tcp://localhost:8000/"));
ChannelFactory<IDoWork> channelFactory = new ChannelFactory<IDoWork>(binding, endpointAddress);
#else
ChannelFactory<IDoWork> channelFactory = new ChannelFactory<IDoWork>("WorkService");
#endif

IDoWork channel = channelFactory.CreateChannel();

@@ -53,8 +58,14 @@ static void CallWorkService()
}

static void CallObjectPooledWorkService()
{
{
#if NET6_0_OR_GREATER
NetTcpBinding binding = new NetTcpBinding();
EndpointAddress endpointAddress = new EndpointAddress(new Uri("net.tcp://localhost:8001/"));
ChannelFactory<IDoWork> channelFactory = new ChannelFactory<IDoWork>(binding, endpointAddress);
#else
ChannelFactory<IDoWork> channelFactory = new ChannelFactory<IDoWork>("ObjectPooledWorkService");
#endif

IDoWork channel = channelFactory.CreateChannel();

Original file line number Diff line number Diff line change
@@ -1,98 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A14DAFDF-2D84-4DC3-A8CE-F81D36FC912F}</ProjectGuid>
<TargetFrameworks>net462;net6.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.ServiceModel.Samples</RootNamespace>
<AssemblyName>Client</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
<Title>Client</Title>
<Description>Pooling Sample</Description>
<Company>Microsoft Corporation</Company>
<Product>Windows Communication Foundation and Windows Workflow Foundation SDK</Product>
<Copyright>Copyright (c) Microsoft Corporation</Copyright>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Xml" />

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<None Remove="App.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="Client.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
<Reference Include="System.ServiceModel" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.VisualBasic.PowerPacks.10.0">
<Visible>False</Visible>
<ProductName>Microsoft Visual Basic PowerPacks 10.0</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="System.ServiceModel.Primitives" Version="6.*" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="6.*" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,37 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{24F59702-9923-4D05-BD39-F4A6D9F0ED78}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.ServiceModel.Samples</RootNamespace>
<AssemblyName>InstancePoolingExtension</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -76,34 +56,12 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.VisualBasic.PowerPacks.10.0">
<Visible>False</Visible>
<ProductName>Microsoft Visual Basic PowerPacks 10.0</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -13,43 +13,43 @@ namespace Microsoft.ServiceModel.Samples
// used to add pooling behavior to the service instance.
public sealed class ObjectPoolingAttribute : Attribute, IServiceBehavior
{
const int defaultMaxPoolSize = 32;
const int defaultMinPoolSize = 0;
int maxPoolSize = defaultMaxPoolSize;
int minPoolSize = defaultMinPoolSize;
private const int DefaultMaxPoolSize = 32;
private const int DefaultMinPoolSize = 0;
private int _maxPoolSize = DefaultMaxPoolSize;
private int _minPoolSize = DefaultMinPoolSize;

// If the service does not already have a ServiceThrottlingBehavior, we will create
// one and forward all IServiceBehavior calls to it. This is used to implement
// MaxPoolSize.
ServiceThrottlingBehavior throttlingBehavior = null;
private ServiceThrottlingBehavior throttlingBehavior = null;

// Gets or sets the maximum number of objects that can be created in the pool
public int MaxPoolSize
{
get { return maxPoolSize; }
get => _maxPoolSize;
set
{
if (value < 0)
{
throw new ArgumentException(ResourceHelper.GetString("ExNegativePoolSize"));
}

this.maxPoolSize = value;
_maxPoolSize = value;
}
}

// Gets or sets the minimum number of objects that can be created in the pool
public int MinPoolSize
{
get { return minPoolSize; }
get => _minPoolSize;
set
{
if (value < 0)
{
throw new ArgumentException(ResourceHelper.GetString("ExNegativePoolSize"));
}

this.minPoolSize = value;
_minPoolSize = value;
}
}

@@ -58,25 +58,25 @@ public int MinPoolSize
void IServiceBehavior.AddBindingParameters(ServiceDescription description, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints, BindingParameterCollection parameters)
{
// Forward the call if we created a ServiceThrottlingBehavior.
if (this.throttlingBehavior != null)
if (throttlingBehavior != null)
{
((IServiceBehavior)this.throttlingBehavior).AddBindingParameters(description, serviceHostBase, endpoints, parameters);
((IServiceBehavior)throttlingBehavior).AddBindingParameters(description, serviceHostBase, endpoints, parameters);
}
}

void IServiceBehavior.ApplyDispatchBehavior(ServiceDescription description, ServiceHostBase serviceHostBase)
{
// Create an instance of the ObjectPoolInstanceProvider.
ObjectPoolingInstanceProvider instanceProvider = new ObjectPoolingInstanceProvider(description.ServiceType,
minPoolSize);
_minPoolSize);

// Forward the call if we created a ServiceThrottlingBehavior.
if (this.throttlingBehavior != null)
if (throttlingBehavior != null)
{
((IServiceBehavior)this.throttlingBehavior).ApplyDispatchBehavior(description, serviceHostBase);
((IServiceBehavior)throttlingBehavior).ApplyDispatchBehavior(description, serviceHostBase);
}

// In case there was already a ServiceThrottlingBehavior (this.throttlingBehavior==null),
// In case there was already a ServiceThrottlingBehavior (throttlingBehavior==null),
// it should have initialized a single ServiceThrottle on all ChannelDispatchers. As
// we loop through the ChannelDispatchers, we verify that and modify the ServiceThrottle
// to guard MaxPoolSize.
@@ -89,7 +89,7 @@ void IServiceBehavior.ApplyDispatchBehavior(ServiceDescription description, Serv
{
// Make sure there is exactly one throttle used by all endpoints.
// If there were others, we could not enforce MaxPoolSize.
if ((this.throttlingBehavior == null) && (this.maxPoolSize != Int32.MaxValue))
if ((throttlingBehavior == null) && (_maxPoolSize != int.MaxValue))
{
if (throttle == null)
{
@@ -115,15 +115,15 @@ void IServiceBehavior.ApplyDispatchBehavior(ServiceDescription description, Serv

// Set the MaxConcurrentInstances to limit the number of items that will
// ever be requested from the pool.
if ((throttle != null) && (throttle.MaxConcurrentInstances > this.maxPoolSize))
if ((throttle != null) && (throttle.MaxConcurrentInstances > _maxPoolSize))
{
throttle.MaxConcurrentInstances = this.maxPoolSize;
throttle.MaxConcurrentInstances = _maxPoolSize;
}
}

void IServiceBehavior.Validate(ServiceDescription description, ServiceHostBase serviceHostBase)
{
if (this.maxPoolSize < this.minPoolSize)
if (_maxPoolSize < _minPoolSize)
{
throw new InvalidOperationException(ResourceHelper.GetString("ExMinLargerThanMax"));
}
@@ -141,18 +141,18 @@ void IServiceBehavior.Validate(ServiceDescription description, ServiceHostBase s
// initializes the ServiceThrottle property of the endpoints. If there is
// no ServiceThrottlingBehavior, we will create one and run it ourselves.
// If there is one, we validate that it comes before us.
int throttlingIndex = this.GetBehaviorIndex(description, typeof(ServiceThrottlingBehavior));
int throttlingIndex = GetBehaviorIndex(description, typeof(ServiceThrottlingBehavior));
if (throttlingIndex == -1)
{
this.throttlingBehavior = new ServiceThrottlingBehavior();
this.throttlingBehavior.MaxConcurrentInstances = this.MaxPoolSize;
throttlingBehavior = new ServiceThrottlingBehavior();
throttlingBehavior.MaxConcurrentInstances = MaxPoolSize;

// Forward the call if we created a ServiceThrottlingBehavior.
((IServiceBehavior)this.throttlingBehavior).Validate(description, serviceHostBase);
((IServiceBehavior)throttlingBehavior).Validate(description, serviceHostBase);
}
else
{
int poolingIndex = this.GetBehaviorIndex(description, typeof(ObjectPoolingAttribute));
int poolingIndex = GetBehaviorIndex(description, typeof(ObjectPoolingAttribute));
if (poolingIndex < throttlingIndex)
{
throw new InvalidOperationException(ResourceHelper.GetString("ExThrottleBeforePool"));
@@ -162,9 +162,9 @@ void IServiceBehavior.Validate(ServiceDescription description, ServiceHostBase s

#endregion

int GetBehaviorIndex(ServiceDescription description, Type behaviorType)
private int GetBehaviorIndex(ServiceDescription description, Type behaviorType)
{
for (int i=0; i<description.Behaviors.Count; i++)
for (int i = 0; i < description.Behaviors.Count; i++)
{
if (behaviorType.IsInstanceOfType(description.Behaviors[i]))
{
Original file line number Diff line number Diff line change
@@ -1,153 +1,144 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Dispatcher;
using System.Threading;
using System.Timers;
using Timer = System.Timers.Timer;

namespace Microsoft.ServiceModel.Samples
{
// This class contains the implementation for the object pool. This implements the
// IInstanceProvider interface in order to be able to plugin to the dispatcher layer.
class ObjectPoolingInstanceProvider : IInstanceProvider
internal class ObjectPoolingInstanceProvider : IInstanceProvider
{
const int idleTimeout = 5 * 60 * 1000; // 5 minutes
private const int IdleTimeout = 5 * 60 * 1000; // 5 minutes

#region Private Fields

// Minimum number of objects in the pool
int minPoolSize;
private readonly int _minPoolSize;

// Type of the object created in the pool
Type instanceType;
private readonly Type _instanceType;

// Stack used for storing objects in the pool
Stack<object> pool;
private readonly Stack<object> _pool;

// Lock should acquired before accessing the pool stack
object poolLock = new object();
private readonly object _poolLock = new object();

// Keeps track of the number of objects returned from the pool.
int activeObjectsCount;
private int _activeObjectsCount;

// Timer object used to trigger the clean up process
// after a given period of idle time.
Timer idleTimer;
private readonly Timer _idleTimer;

#endregion

public ObjectPoolingInstanceProvider(Type instanceType, int minPoolSize)
{
this.minPoolSize = minPoolSize;
this.instanceType = instanceType;
{
_minPoolSize = minPoolSize;
_instanceType = instanceType;

pool = new Stack<object>();
activeObjectsCount = 0;
_pool = new Stack<object>();
_activeObjectsCount = 0;

// Initialize the timer and subscribe to the "Elapsed" event
idleTimer = new Timer(idleTimeout);
idleTimer.Elapsed += new System.Timers.ElapsedEventHandler(idleTimer_Elapsed);
_idleTimer = new Timer(IdleTimeout);
_idleTimer.Elapsed += new System.Timers.ElapsedEventHandler(idleTimer_Elapsed);

// Initialize the minimum number of objects if possible
Initialize();
}

#region IInstanceProvider Members

object IInstanceProvider.GetInstance(InstanceContext instanceContext)
{
return ((IInstanceProvider)this).GetInstance(instanceContext, null);
}
object IInstanceProvider.GetInstance(InstanceContext instanceContext) => ((IInstanceProvider)this).GetInstance(instanceContext, null);

object IInstanceProvider.GetInstance(InstanceContext instanceContext, Message message)
{
object obj = null;

lock (poolLock)
lock (_poolLock)
{
if (pool.Count > 0)
if (_pool.Count > 0)
{
obj = pool.Pop();
obj = _pool.Pop();
}
else
{
obj = CreateNewPoolObject();
}
activeObjectsCount++;
_activeObjectsCount++;
}

WritePoolMessage(ResourceHelper.GetString("MsgNewObject"));

idleTimer.Stop();
_idleTimer.Stop();

return obj;
return obj;
}

void IInstanceProvider.ReleaseInstance(InstanceContext instanceContext, object instance)
{
lock (poolLock)
lock (_poolLock)
{
pool.Push(instance);
activeObjectsCount--;
_pool.Push(instance);
_activeObjectsCount--;

WritePoolMessage(ResourceHelper.GetString("MsgObjectPooled"));

// When the service goes completely idle (no requests are being processed),
// the idle timer is started
if (activeObjectsCount == 0)
idleTimer.Start();
if (_activeObjectsCount == 0)
_idleTimer.Start();
}
}

#endregion

// Initialize the pool with minimum number of instances
void Initialize()
private void Initialize()
{
for (int i = 0; i < minPoolSize; i++)
for (int i = 0; i < _minPoolSize; i++)
{
pool.Push(CreateNewPoolObject());
_pool.Push(CreateNewPoolObject());
}
}

// Handles the instantiation of the types created by this instance
private object CreateNewPoolObject()
{
return Activator.CreateInstance(instanceType);
}
private object CreateNewPoolObject() => Activator.CreateInstance(_instanceType);

// Clean up procedure
void idleTimer_Elapsed(object sender, ElapsedEventArgs args)
private void idleTimer_Elapsed(object sender, ElapsedEventArgs args)
{
idleTimer.Stop();
_idleTimer.Stop();

lock (poolLock)
lock (_poolLock)
{
if (activeObjectsCount == 0)
if (_activeObjectsCount == 0)
{
while (pool.Count > minPoolSize)
while (_pool.Count > _minPoolSize)
{
WritePoolMessage(ResourceHelper.GetString("MsgObjectRemoving"));
object removedItem = pool.Pop();

object removedItem = _pool.Pop();

if (removedItem is IDisposable)
{
((IDisposable)removedItem).Dispose();
}
}
}
}
}
}

// Writes a given message to the console in red color
void WritePoolMessage(string message)
private void WritePoolMessage(string message)
{
ConsoleColor currentForegroundColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Red;
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.

using System;
using System.Globalization;
using System.Resources;
using System.Reflection;
using System.Threading;
using System.Resources;

namespace Microsoft.ServiceModel.Samples
{
class ResourceHelper
internal class ResourceHelper
{
// Gets the string associated with the specified key from the resource file
public static string GetString(string key)
Original file line number Diff line number Diff line change
@@ -19,4 +19,4 @@
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.

using System;
using System.ServiceModel.Channels;
using System.ServiceModel;
using System.Threading;

Original file line number Diff line number Diff line change
@@ -1,37 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{AE58B0A0-F124-4ABE-8543-42110CFA8959}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.ServiceModel.Samples</RootNamespace>
<AssemblyName>Service</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -71,34 +51,12 @@
<Name>Extensions</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.VisualBasic.PowerPacks.10.0">
<Visible>False</Visible>
<ProductName>Microsoft Visual Basic PowerPacks 10.0</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>