求助各位大師:WCF中如何用代碼配置修改maxItemsInObjectGraph長度限制,
原代碼:
ServiceHost host = new ServiceHost(typeof(MainServer), new Uri(tcpaddress));
host.AddServiceEndpoint(typeof(IMainServer), tcpBinding, tcpaddress);
ServiceMetadataBehavior behavior = new ServiceMetadataBehavior();
behavior.HttpGetEnabled = false;
host.Description.Behaviors.Add(behavior);
host.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexTcpBinding(), "mex");
host.Open();
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/16209.html
標籤:C#
上一篇:Visual Studio2017需要更新版本的Windows才能顯示MainPage.XAML 要升級到1903 C#編程中
