diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/App.config b/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/App.config
index 5f366b7a8d5..faa88219657 100644
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/App.config
+++ b/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/App.config
@@ -16,4 +16,4 @@
-
+
diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/Client.cs b/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/Client.cs
index fac2787d25f..c5b19dba7f7 100644
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/Client.cs
+++ b/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/Client.cs
@@ -1,13 +1,13 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.
using System;
-using System.ServiceModel.Channels;
using System.ServiceModel;
+using System.ServiceModel.Channels;
namespace Microsoft.ServiceModel.Samples
{
- [ServiceContract(SessionMode=SessionMode.Required)]
- interface IEchoService
+ [ServiceContract(SessionMode = SessionMode.Required)]
+ internal interface IEchoService
{
[OperationContract]
string Echo(string value);
@@ -15,30 +15,32 @@ interface IEchoService
public static class CustomHeader
{
- public static readonly String HeaderName = "InstanceId";
- public static readonly String HeaderNamespace = "http://Microsoft.ServiceModel.Samples/Lifetime";
+ public const string HeaderName = "InstanceId";
+ public const string HeaderNamespace = "http://Microsoft.ServiceModel.Samples/Lifetime";
}
- class Program
+ internal class Program
{
static void Main(string[] args)
{
- Console.WriteLine(
- "Press to open a channel and send a request.");
+ Console.WriteLine("Press to open a channel and send a request.");
Console.ReadLine();
-
+
MessageHeader shareableInstanceContextHeader = MessageHeader.CreateHeader(
CustomHeader.HeaderName,
CustomHeader.HeaderNamespace,
Guid.NewGuid().ToString());
- ChannelFactory channelFactory =
- new ChannelFactory("echoservice");
-
+#if NET6_0_OR_GREATER
+ CustomBinding binding = new CustomBinding(new TextMessageEncodingBindingElement(), new TcpTransportBindingElement());
+ EndpointAddress endpointAddress = new EndpointAddress(new Uri("net.tcp://localhost:9000/echoservice"));
+ ChannelFactory channelFactory = new ChannelFactory(binding, endpointAddress);
+#else
+ ChannelFactory channelFactory = new ChannelFactory("echoservice");
+#endif
IEchoService proxy = channelFactory.CreateChannel();
-
using (new OperationContextScope((IClientChannel)proxy))
{
OperationContext.Current.OutgoingMessageHeaders.Add(shareableInstanceContextHeader);
@@ -52,8 +54,8 @@ static void Main(string[] args)
Console.WriteLine("Channel No 1 closed.");
Console.WriteLine(
- "Press to send another request from a different channel " +
- "to the same instance. ");
+ "Press to send another request from a different channel " +
+ "to the same instance. ");
Console.ReadLine();
@@ -66,11 +68,11 @@ static void Main(string[] args)
Console.WriteLine("Service returned: " + proxy.Echo("Apple"));
Console.ForegroundColor = ConsoleColor.Gray;
}
-
+
((IChannel)proxy).Close();
Console.WriteLine("Channel No 2 closed.");
-
+
Console.WriteLine("Press to complete test.");
Console.ReadLine();
}
diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/Client.csproj b/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/Client.csproj
index 0916ba47535..405ed8e54f3 100644
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/Client.csproj
+++ b/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/Client.csproj
@@ -1,100 +1,24 @@
-
-
+
- Debug
- AnyCPU
- 8.0.50727
- 2.0
- {141A9C5A-0610-4F1B-BDD5-1EAF8416850E}
+ net462;net6.0
Exe
- Properties
- Microsoft.ServiceModel.Samples
- Client
- v4.0
-
-
-
-
- 2.0
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
+ Client
+ Lifetime sample
+ Microsoft Corporation
+ Windows Communication Foundation and Windows Workflow Foundation SDK
+ Copyright (c) Microsoft Corporation
-
- true
- full
- false
- bin\
- DEBUG;TRACE
- prompt
- 4
- AllRules.ruleset
-
-
- pdbonly
- true
- bin\
- TRACE
- prompt
- 4
- AllRules.ruleset
-
-
-
-
-
- False
-
-
-
-
-
-
+
+
+
-
-
+
+
+
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- true
-
-
- False
- Microsoft Visual Basic PowerPacks 10.0
- true
-
-
- False
- Windows Installer 3.1
- true
-
+
+
+
+
-
-
-
\ No newline at end of file
+
diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/Properties/AssemblyInfo.cs b/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/Properties/AssemblyInfo.cs
deleted file mode 100644
index b67408860ee..00000000000
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/client/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) Microsoft Corporation. All Rights Reserved.
-
-using System;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Client")]
-[assembly: AssemblyDescription("Lifetime sample")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("Client")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2006")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-[assembly:CLSCompliant(true)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("3a9b4afb-5444-4992-82fd-75d9f5b75ef1")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/CustomLeaseExtension.cs b/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/CustomLeaseExtension.cs
index 0bd6ba62a39..58f5b316516 100644
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/CustomLeaseExtension.cs
+++ b/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/CustomLeaseExtension.cs
@@ -3,21 +3,18 @@
#region using
using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
using System.ServiceModel;
+using System.ServiceModel.Dispatcher;
using System.Timers;
using Timer = System.Timers.Timer;
-using System.ServiceModel.Dispatcher;
#endregion
namespace Microsoft.ServiceModel.Samples
{
- interface ICustomLease
+ internal interface ICustomLease
{
- bool IsIdle { get; }
+ bool IsIdle { get; }
InstanceContextIdleCallback Callback { get; set; }
}
@@ -25,41 +22,33 @@ interface ICustomLease
/// This class contains the implementation of an extension to InstanceContext.
/// This enables extended lifetime for the InstanceContext.
///
- class CustomLeaseExtension : IExtension, ICustomLease
+ internal class CustomLeaseExtension : IExtension, ICustomLease
{
#region Private Fields
// Reference to the InstanceContext instance owns this
// extension instance.
- InstanceContext owner;
-
- bool isIdle;
- object thisLock;
- Timer idleTimer;
- double idleTimeout;
- InstanceContextIdleCallback callback;
- string instanceId;
-
- public String InstanceId
- {
- get
- {
- return this.instanceId;
- }
- }
+ private InstanceContext _owner;
+ private bool _isIdle;
+ private readonly object _thisLock;
+ private readonly Timer _idleTimer;
+ private readonly double _idleTimeout;
+ private InstanceContextIdleCallback _callback;
+
+ public string InstanceId { get; }
#endregion
#region Constructor
- public CustomLeaseExtension(double idleTimeout, String instanceId)
+ public CustomLeaseExtension(double idleTimeout, string instanceId)
{
- owner = null;
- isIdle = false;
- thisLock = new object();
- idleTimer = new Timer();
- this.idleTimeout = idleTimeout;
- this.instanceId = instanceId;
+ _owner = null;
+ _isIdle = false;
+ _thisLock = new object();
+ _idleTimer = new Timer();
+ _idleTimeout = idleTimeout;
+ InstanceId = instanceId;
}
#endregion
@@ -74,13 +63,10 @@ public CustomLeaseExtension(double idleTimeout, String instanceId)
/// This method is called by WCF at the time it attaches this
/// extension.
///
- public void Attach(InstanceContext owner)
- {
- this.owner = owner;
- }
+ public void Attach(InstanceContext owner) => _owner = owner;
public void Detach(InstanceContext owner)
- {
+ {
}
#endregion
@@ -95,9 +81,9 @@ public bool IsIdle
{
get
{
- lock (thisLock)
+ lock (_thisLock)
{
- if (isIdle)
+ if (_isIdle)
{
return true;
}
@@ -109,7 +95,7 @@ public bool IsIdle
}
}
}
-
+
///
/// Gets or sets the InstanceContextIdleCallback.
///
@@ -117,23 +103,23 @@ public InstanceContextIdleCallback Callback
{
get
{
- lock (thisLock)
+ lock (_thisLock)
{
- return callback;
+ return _callback;
}
}
set
{
// Immutable state.
- if (idleTimer.Enabled)
+ if (_idleTimer.Enabled)
{
throw new InvalidOperationException(
ResourceHelper.GetString("ExCannotChangeCallback"));
}
- lock (thisLock)
+ lock (_thisLock)
{
- callback = value;
+ _callback = value;
}
}
}
@@ -145,27 +131,27 @@ public InstanceContextIdleCallback Callback
///
/// Starts the timer.
///
- void StartTimer()
+ private void StartTimer()
{
- lock (thisLock)
+ lock (_thisLock)
{
- idleTimer.Interval = idleTimeout;
- idleTimer.Elapsed += new ElapsedEventHandler(idleTimer_Elapsed);
+ _idleTimer.Interval = _idleTimeout;
+ _idleTimer.Elapsed += new ElapsedEventHandler(idleTimer_Elapsed);
- if (!idleTimer.Enabled)
+ if (!_idleTimer.Enabled)
{
- idleTimer.Start();
+ _idleTimer.Start();
}
}
}
public void StopTimer()
{
- lock (thisLock)
+ lock (_thisLock)
{
- if (idleTimer.Enabled)
+ if (_idleTimer.Enabled)
{
- idleTimer.Stop();
+ _idleTimer.Stop();
}
}
}
@@ -173,19 +159,19 @@ public void StopTimer()
///
/// Timer elapsed event handler.
///
- void idleTimer_Elapsed(object sender, ElapsedEventArgs args)
+ private void idleTimer_Elapsed(object sender, ElapsedEventArgs args)
{
- lock (thisLock)
+ lock (_thisLock)
{
StopTimer();
- isIdle = true;
+ _isIdle = true;
Utility.WriteMessageToConsole(
ResourceHelper.GetString("MsgLeaseExpired"));
- callback(owner);
+ _callback(_owner);
}
- }
+ }
#endregion
-
+
}
}
diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/CustomLeaseTimeAttribute.cs b/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/CustomLeaseTimeAttribute.cs
index e8e6dff7558..24f5b64631b 100644
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/CustomLeaseTimeAttribute.cs
+++ b/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/CustomLeaseTimeAttribute.cs
@@ -1,11 +1,11 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.
using System;
-using System.ServiceModel.Dispatcher;
-using System.ServiceModel.Description;
-using System.ServiceModel.Channels;
-using System.ServiceModel;
using System.Collections.ObjectModel;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Dispatcher;
namespace Microsoft.ServiceModel.Samples
{
@@ -17,8 +17,6 @@ public sealed class CustomLeaseTimeAttribute : Attribute, IServiceBehavior
{
#region Private Fields
- double timeout;
-
#endregion
#region Properties
@@ -26,11 +24,7 @@ public sealed class CustomLeaseTimeAttribute : Attribute, IServiceBehavior
///
/// Gets or sets the custom lease time.
///
- public double Timeout
- {
- get { return this.timeout; }
- set { this.timeout = value; }
- }
+ public double Timeout { get; set; }
#endregion
@@ -49,12 +43,12 @@ public void AddBindingParameters(ServiceDescription description, ServiceHostBase
///
public void ApplyDispatchBehavior(ServiceDescription description, ServiceHostBase serviceHostBase)
{
- CustomLifetimeLease customLease = new CustomLifetimeLease(timeout);
+ CustomLifetimeLease customLease = new CustomLifetimeLease(Timeout);
foreach (ChannelDispatcherBase cdb in serviceHostBase.ChannelDispatchers)
{
ChannelDispatcher cd = cdb as ChannelDispatcher;
-
+
if (cd != null)
{
foreach (EndpointDispatcher ed in cd.Endpoints)
diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/CustomLifetimeLease.cs b/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/CustomLifetimeLease.cs
index 2bcccdf1476..7a0537eae11 100644
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/CustomLifetimeLease.cs
+++ b/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/CustomLifetimeLease.cs
@@ -1,19 +1,16 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.
using System;
+using System.Collections.Generic;
using System.ServiceModel;
-using System.Timers;
-using Timer = System.Timers.Timer;
using System.ServiceModel.Dispatcher;
-using System.Collections;
-using System.Collections.Generic;
namespace Microsoft.ServiceModel.Samples
{
public static class CustomHeader
{
- public static readonly String HeaderName = "InstanceId";
- public static readonly String HeaderNamespace = "http://Microsoft.ServiceModel.Samples/Lifetime";
+ public const string HeaderName = "InstanceId";
+ public const string HeaderNamespace = "http://Microsoft.ServiceModel.Samples/Lifetime";
}
///
@@ -22,13 +19,13 @@ public static class CustomHeader
/// IShareableInstanceContextLifetime in order to be able
/// to attach to the service model layer.
///
- class CustomLifetimeLease : IInstanceContextProvider
+ internal class CustomLifetimeLease : IInstanceContextProvider
{
#region Private Fields
-
- double timeout;
- bool isIdle;
- Dictionary instanceContextCache;
+
+ private readonly double _timeout;
+ private bool _isIdle;
+ private readonly Dictionary _instanceContextCache;
// Lock must be acquired on this before
// accessing the isIdle member.
@@ -41,7 +38,7 @@ class CustomLifetimeLease : IInstanceContextProvider
// it will result in a considerable perf hit or
// even cause dead locks depending on how
// service model handles threads.
- object thisLock;
+ private readonly object _thisLock;
#endregion
@@ -52,9 +49,9 @@ class CustomLifetimeLease : IInstanceContextProvider
///
public CustomLifetimeLease(double timeout)
{
- this.timeout = timeout;
- thisLock = new object();
- this.instanceContextCache = new Dictionary();
+ _timeout = timeout;
+ _thisLock = new object();
+ _instanceContextCache = new Dictionary();
}
#endregion
@@ -63,9 +60,9 @@ public CustomLifetimeLease(double timeout)
public bool IsIdle(InstanceContext instanceContext)
{
- lock (thisLock)
+ lock (_thisLock)
{
- if (isIdle)
+ if (_isIdle)
{
Utility.WriteMessageToConsole(
ResourceHelper.GetString("MsgIdle"));
@@ -76,27 +73,27 @@ public bool IsIdle(InstanceContext instanceContext)
ResourceHelper.GetString("MsgNotIdle"));
}
- bool idleCopy = isIdle;
- isIdle = false;
+ bool idleCopy = _isIdle;
+ _isIdle = false;
return idleCopy;
}
}
- public void NotifyIdle(InstanceContextIdleCallback callback,
+ public void NotifyIdle(InstanceContextIdleCallback callback,
InstanceContext instanceContext)
{
- lock (thisLock)
+ lock (_thisLock)
{
ICustomLease customLease =
instanceContext.Extensions.Find();
- customLease.Callback = callback;
- isIdle = customLease.IsIdle;
- if (isIdle)
+ customLease.Callback = callback;
+ _isIdle = customLease.IsIdle;
+ if (_isIdle)
{
callback(instanceContext);
- }
- }
+ }
+ }
}
///
@@ -112,21 +109,21 @@ public InstanceContext GetExistingInstanceContext(System.ServiceModel.Channels.M
//Check if the incoming request has the InstanceContext id it wants to connect with.
if (message.Headers.FindHeader(CustomHeader.HeaderName, CustomHeader.HeaderNamespace) != -1)
{
- String sharingId = message.Headers.GetHeader(CustomHeader.HeaderName, CustomHeader.HeaderNamespace);
- if (sharingId != null && instanceContextCache.ContainsKey(sharingId))
+ string sharingId = message.Headers.GetHeader(CustomHeader.HeaderName, CustomHeader.HeaderNamespace);
+ if (sharingId != null && _instanceContextCache.ContainsKey(sharingId))
{
- Utility.WriteMessageToConsole(String.Format(ResourceHelper.GetString("InstanceContextLookup"),sharingId));
+ Utility.WriteMessageToConsole(string.Format(ResourceHelper.GetString("InstanceContextLookup"), sharingId));
//Retrieve the InstanceContext from the map
- InstanceContext context = instanceContextCache[sharingId];
+ InstanceContext context = _instanceContextCache[sharingId];
if (context != null)
{
//Before returning, stop the timer on this InstanceContext
CustomLeaseExtension extension = context.Extensions.Find();
- Utility.WriteMessageToConsole(String.Format(ResourceHelper.GetString("StopInstanceContextIdleTimer"), sharingId));
+ Utility.WriteMessageToConsole(string.Format(ResourceHelper.GetString("StopInstanceContextIdleTimer"), sharingId));
extension.StopTimer();
Utility.WriteMessageToConsole(ResourceHelper.GetString("CachedInstanceContextFound"));
- return instanceContextCache[sharingId];
+ return _instanceContextCache[sharingId];
}
}
}
@@ -139,7 +136,7 @@ public void InitializeInstanceContext(InstanceContext instanceContext, System.Se
{
//Look if the Client has given us a unique ID to add to this InstanceContext
int headerIndex = message.Headers.FindHeader(CustomHeader.HeaderName, CustomHeader.HeaderNamespace);
- String headerId = null;
+ string headerId = null;
if (headerIndex != -1)
{
headerId = message.Headers.GetHeader(headerIndex);
@@ -149,31 +146,31 @@ public void InitializeInstanceContext(InstanceContext instanceContext, System.Se
{
//If no header was sent by the Client, then create a new one and assign it to this InstanceContext.
headerId = Guid.NewGuid().ToString();
- Utility.WriteMessageToConsole(String.Format(ResourceHelper.GetString("NoHeaderFound")));
+ Utility.WriteMessageToConsole(string.Format(ResourceHelper.GetString("NoHeaderFound")));
}
- Utility.WriteMessageToConsole(String.Format(ResourceHelper.GetString("InstanceContextAddedToCache"), headerId));
+ Utility.WriteMessageToConsole(string.Format(ResourceHelper.GetString("InstanceContextAddedToCache"), headerId));
//Add this to the Cache
- this.instanceContextCache[headerId] = instanceContext;
+ _instanceContextCache[headerId] = instanceContext;
//Register the Closing event of this InstancContext so it can be removed from the collection
- instanceContext.Closing += this.RemoveInstanceContext;
+ instanceContext.Closing += RemoveInstanceContext;
IExtension customLeaseExtension =
- new CustomLeaseExtension(timeout, headerId);
- instanceContext.Extensions.Add(customLeaseExtension);
+ new CustomLeaseExtension(_timeout, headerId);
+ instanceContext.Extensions.Add(customLeaseExtension);
}
public void RemoveInstanceContext(object o, EventArgs args)
{
InstanceContext context = o as InstanceContext;
CustomLeaseExtension extension = context.Extensions.Find();
- String id = (extension != null) ? extension.InstanceId : null;
- if (this.instanceContextCache[id] != null)
+ string id = (extension != null) ? extension.InstanceId : null;
+ if (_instanceContextCache[id] != null)
{
- Utility.WriteMessageToConsole(String.Format(ResourceHelper.GetString("InstanceContextRemovedFromCache"), id));
- this.instanceContextCache.Remove(id);
+ Utility.WriteMessageToConsole(string.Format(ResourceHelper.GetString("InstanceContextRemovedFromCache"), id));
+ _instanceContextCache.Remove(id);
}
}
#endregion
diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/Extensions.csproj b/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/Extensions.csproj
index 011527897ea..76dca65c346 100644
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/Extensions.csproj
+++ b/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/Extensions.csproj
@@ -1,37 +1,17 @@
-
+
+
Debug
AnyCPU
8.0.50727
- 2.0
{286B7623-BDB9-409A-8489-A3D3FCEFEED4}
Library
Properties
Microsoft.ServiceModel.Samples
InstancePoolingExtension
- v4.0
-
-
-
-
- 2.0
+ v4.6.2
publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
true
@@ -55,12 +35,8 @@
-
- False
-
-
- False
-
+
+
@@ -83,29 +59,7 @@
Resources.Designer.cs
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- true
-
-
- False
- Microsoft Visual Basic PowerPacks 10.0
- true
-
-
- False
- Windows Installer 3.1
- true
-
-
-
+
-
\ No newline at end of file
+
diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/Properties/AssemblyInfo.cs b/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/Properties/AssemblyInfo.cs
index 8d9f08d06b7..ddc0b563cbe 100644
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/Properties/AssemblyInfo.cs
+++ b/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/Properties/AssemblyInfo.cs
@@ -2,7 +2,6 @@
using System;
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/ResourceHelper.cs b/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/ResourceHelper.cs
index 179200040de..cc5b9c0e80b 100644
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/ResourceHelper.cs
+++ b/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/ResourceHelper.cs
@@ -2,21 +2,18 @@
#region using
-using System;
-using System.Globalization;
-using System.Resources;
using System.Reflection;
-using System.Threading;
+using System.Resources;
#endregion
-
+
namespace Microsoft.ServiceModel.Samples
{
///
/// This is a helper class for accessing the
/// resource file.
///
- class ResourceHelper
+ internal class ResourceHelper
{
#region Public Static Members
diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/Utility.cs b/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/Utility.cs
index c43ccfe3b1f..9c4ba5e8e99 100644
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/Utility.cs
+++ b/framework/wcf/Extensibility/Instancing/Lifetime/CS/extensions/Utility.cs
@@ -4,7 +4,7 @@
namespace Microsoft.ServiceModel.Samples
{
- class Utility
+ internal class Utility
{
public static void WriteMessageToConsole(string message)
{
diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/App.config b/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/App.config
index e51f2b9f27b..39a05f6b361 100644
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/App.config
+++ b/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/App.config
@@ -17,4 +17,4 @@
-
+
diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/Properties/AssemblyInfo.cs b/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/Properties/AssemblyInfo.cs
index e32b64d5920..4e2905e8151 100644
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/Properties/AssemblyInfo.cs
+++ b/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/Properties/AssemblyInfo.cs
@@ -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
diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/Service.cs b/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/Service.cs
index 6c87ecb88d1..ead3a8c1f4a 100644
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/Service.cs
+++ b/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/Service.cs
@@ -1,12 +1,11 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved.
using System;
-using System.ServiceModel.Channels;
using System.ServiceModel;
namespace Microsoft.ServiceModel.Samples
{
- [ServiceContract(SessionMode=SessionMode.Required)]
+ [ServiceContract(SessionMode = SessionMode.Required)]
public interface IEchoService
{
[OperationContract]
@@ -22,7 +21,7 @@ public EchoService()
Console.WriteLine("Service instance created.");
Console.ForegroundColor = ConsoleColor.Gray;
}
-
+
public string Echo(string value)
{
Console.ForegroundColor = ConsoleColor.Blue;
@@ -33,7 +32,7 @@ public string Echo(string value)
}
}
- class Program
+ internal class Program
{
static void Main(string[] args)
{
@@ -46,12 +45,12 @@ static void Main(string[] args)
Console.WriteLine("Echo service started.");
Console.ForegroundColor = ConsoleColor.Gray;
- Console.WriteLine("Press to complete test.");
+ Console.WriteLine("Press to complete test.");
Console.ReadLine();
host.Close();
}
- static void PrintLegend()
+ private static void PrintLegend()
{
Console.WriteLine("=================================");
diff --git a/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/Service.csproj b/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/Service.csproj
index 4ba11eda188..0305185b30b 100644
--- a/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/Service.csproj
+++ b/framework/wcf/Extensibility/Instancing/Lifetime/CS/service/Service.csproj
@@ -1,37 +1,17 @@
-
+
+
Debug
AnyCPU
8.0.50727
- 2.0
{E08400D5-2EE3-4798-A8E5-C0C2C1882E90}
Exe
Properties
Microsoft.ServiceModel.Samples
Service
- v4.0
-
-
-
-
- 2.0
+ v4.6.2
publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
true
@@ -55,9 +35,7 @@
-
- False
-
+
@@ -73,29 +51,7 @@
Extensions
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- true
-
-
- False
- Microsoft Visual Basic PowerPacks 10.0
- true
-
-
- False
- Windows Installer 3.1
- true
-
-
-
+
-
\ No newline at end of file
+