WCF 서비스 인 VS2010 C#을 사용하여 데이터를 얻으려는 라이브러리가 서비스의 콘솔 응용 프로그램에서 제대로 작동합니다. 문제 없어.Visual Studio에서 WCF 서비스를 호스팅 할 포트를 열 수 없습니다.
이전 프로젝트의 경우 VS2008 프로젝트 (그리고 나중에는 VS2005)에서 사용해야합니다. 그런 다음 VS2010을 시작하고 "WCF 테스트 클라이언트"를 얻습니다. VS2008의 이번에는 로컬 시스템에 "웹 참조 추가"를 시도했습니다 ... 결과가 없습니다. URL을 등록 할 수 없습니다 HTTP - 나는이 오류 "AddressAccessDeniedException를 얻을 수는 Open()
에 오류가
Uri baseAddress = new Uri("http://localhost:8080/hello");
using (ServiceHost host = new ServiceHost(typeof(SecurityAccessWCF.WCFSecurityService), baseAddress))
{
// Enable metadata publishing.
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
host.Description.Behaviors.Add(smb);
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();
}
:
그럼 내가 이런 짓을, 그것은 호스트 VS2010와 콘솔 응용 프로그램을 만들려고. ..
또는 VisualStudio에 대한 바로 가기 등록 정보로 이동하면 호환성에서 관리자로 항상 실행되도록 표시 할 수 있습니다 . WCF와 함께 사용하고자하는 모든 URL을 등록하는 것보다 훨씬 쉽기 때문에이 작업을 마쳤습니다. – CodingWithSpike