C# OWIN/Katana内存集成测试的WCF等效物
对于OWIN/KATANA,可以使用内存托管解决方案:Microsoft.AspNet.WebApi.OwinSelfHost。我想为WCF服务找到类似的方法—可以在内存中运行的集成测试。它只是自托管服务吗C# OWIN/Katana内存集成测试的WCF等效物,c#,wcf,C#,Wcf,对于OWIN/KATANA,可以使用内存托管解决方案:Microsoft.AspNet.WebApi.OwinSelfHost。我想为WCF服务找到类似的方法—可以在内存中运行的集成测试。它只是自托管服务吗 // Create the ServiceHost. using (ServiceHost host = new ServiceHost(typeof(HelloWorldService), baseAddress)) { // Enable metadata publishing.
// Create the ServiceHost.
using (ServiceHost host = new ServiceHost(typeof(HelloWorldService), baseAddress))
{
// Enable metadata publishing.
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
host.Description.Behaviors.Add(smb);
// Open the ServiceHost to start listening for messages. Since
// no endpoints are explicitly configured, the runtime will create
// one endpoint per base address for each service contract implemented
// by the service.
host.Open();
Console.WriteLine("The service is ready at {0}", baseAddress);
Console.WriteLine("Press <Enter> to stop the service.");
Console.ReadLine();
// Close the ServiceHost.
host.Close();
}