프로그래밍 방식 구성
일부 경우에는 프로그래밍 방식 구성이 유용합니다. 구성 파일은 응용 프로그램을 다시 컴파일할 필요 없이 빠르게 리디렉션하는 데 유용할 수 있지만, 호스팅하는 응용 프로그램 도메인과 클라이언트 도메인에서 원격 형식을 직접 구성할 수도 있습니다. 이 때 일반적인 구성 요구 사항이 적용됩니다. 다음 코드 예에서는 수신 응용 프로그램 도메인의 간단한 프로그래밍 방식 구성을 보여 줍니다.
ChannelServices.RegisterChannel(New HttpChannel())
Dim WKSTE As New WellKnownServiceTypeEntry(GetType(ServiceClass), "HttpService", WellKnownObjectMode.SingleCall)
RemotingConfiguration.ApplicationName = "HttpService"
RemotingConfiguration.RegisterWellKnownServiceType(WKSTE)
ChannelServices.RegisterChannel(new HttpChannel());
WellKnownServiceTypeEntry WKSTE = new WellKnownServiceTypeEntry(typeof(ServiceClass),"HttpService", WellKnownObjectMode.SingleCall);
RemotingConfiguration.ApplicationName = "HttpService";
RemotingConfiguration.RegisterWellKnownServiceType(WKSTE);
원격 개체의 특정 인스턴스를 프로그래밍 방식으로 게시한 다음 게시에서 해당 개체를 제거하는 것 같은 보다 복잡한 시나리오에서는 이러한 유형의 구성이 요구 사항이 됩니다. 자세한 내용은 고급 원격 서비스 및 원격 서비스 예: 동적 게시를 참조하십시오.
참고 항목
참조
RemotingConfiguration
ChannelServices