가 발생합니다 -이 할 그러나 때마다 :ServiceModel.Discovery.DiscoveryClient (문자열 endpointConfigurationName는) 내가 응용 프로그램 구성 파일을 통해 서비스 검색에 대해 구성하기 위해 노력하고있어 작은 WCF 클라이언트이 경우 ArgumentNullException
// Create a new DiscoveryClient instance from the 'DiscoveryEndpoint'
// configuration in App.config
DiscoveryClient discoveryClient = new DiscoveryClient("DiscoveryEndpoint");
I을 ArgumentNullException
, Value cannot be null. Parameter name: contract
을 얻으십시오. DiscoveryClient
생성자의 오버로드에 대해 contract
매개 변수가없고 계약이 App.config (아래 참조)에 올바르게 지정되어 있습니다.
<system.serviceModel>
<client>
<endpoint name="DiscoveryEndpoint"
contract="IExampleContract"
kind="dynamicEndpoint"
endpointConfiguration="DynamicEndpointConfiguration"/>
</client>
<standardEndpoints>
<dynamicEndpoint>
<standardEndpoint name="DynamicEndpointConfiguration">
<discoveryClientSettings>
<endpoint kind="udpDiscoveryEndpoint"/>
<findCriteria duration="00:00:02">
<types>
<add name="IExampleContract"/>
</types>
<scopes>
<add scope="urn://wcf.test.com/examples/exampleContract/development"/>
</scopes>
</findCriteria>
</discoveryClientSettings>
</standardEndpoint>
</dynamicEndpoint>
</standardEndpoints>
</system.serviceModel>
이것은 비주얼 스튜디오 2010 SP1을 사용하여 .NET 프레임 워크 4.0에서 타겟으로한다 : 여기
은의 App.config의 관련 부분이다.DiscoveryClient(string) 생성자에 대한 과부하에 대한 설명은 App.config에 식별 된 구성을 사용하여 DiscoveryClient
인스턴스를 새로 만들어야 함을 나타냅니다.
다른 사람이이 문제가 발생 했습니까? 그렇다면 어떻게 해결 했습니까?