Good afternoon, I had a need to build a serviceendpoint in the service solely by software without using app.config, and I came across an unsolvable problem with ContractDescription, more precisely
When configuring it is compressed
ValueConfigurationService.WCFServiceHost.AddServiceEndpoint(typeof(WCFService), new BasicHttpsBinding(), new Uri("http://localhost:8745/")); everything is working. But there is no such configuration (extended)
ValueConfigurationService.MainEndpointRequesting = new System.ServiceModel.Description.ServiceEndpoint(new ContractDescription("WorkStation1.IWCFService")); ValueConfigurationService.MainEndpointRequesting.Name = "MainEndpointRequesting"; ValueConfigurationService.MainEndpointRequesting.Address = new System.ServiceModel.EndpointAddress(new Uri(ValueConfigurationService.AddressMainEndpoint)); ValueConfigurationService.MainEndpointRequesting.Binding = ValueConfigurationService.ConfigurationBinding; ValueConfigurationService.MainEndpointRequesting.Contract.Name = "AAAAAAAAAAAA"; //ValueConfigurationService.MainEndpointRequesting.Contract = ContractDescription.GetContract(typeof(WorkStation1.IWCFService), typeof(WorkStation1.WCFService)); ValueConfigurationService.MainEndpointRequesting.Contract.ProtectionLevel = ProtectionLevel.None; ValueConfigurationService.MainEndpointRequesting.Contract.SessionMode = System.ServiceModel.SessionMode.Allowed; ValueConfigurationService.MainEndpointRequesting.EndpointBehaviors.Add(ConfigurationBehavior); writes that there is a problem with contracts
System.ArgumentNullException: Value cannot be null. Parameter name: key
The question is how to add the type of contract and type of service to this point.