MaxReceivedMessageSize in WCF Hosted Service in console application
问题 I have a hosted WCF service in my console application as follow: static void Main(string[] args) { Uri baseAddress = new Uri("http://localhost:8080/Test"); // Create the ServiceHost. using (ServiceHost host = new ServiceHost(typeof(TestService), baseAddress)) { // Enable metadata publishing. ServiceMetadataBehavior smb = new ServiceMetadataBehavior(); smb.HttpGetEnabled = true; smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15; host.Description.Behaviors.Add(smb); host.Open();