현재 IIS에서 Framework 2에서 .Net Remoting 응용 프로그램을 실행하고있었습니다. 몇 가지 새로운 구성 요소를 사용하려면 프레임 워크 4로 업그레이드해야합니다. 모든 것을 프레임 워크 2에서 다룰 수 있었지만 프레임 워크 4로 변경하자마자 내 원격 객체의 기능 중 하나를 호출하려고 할 때 다음과 같은 예외가 발생합니다.프레임 워크 2에서 4 로의 .Net Remoting 관련 문제
The input stream is not a valid binary format.
The starting contents (in bytes) are:
53-79-73-74-65-6D-2E-52-75-6E-74-69-6D-65-2E-52-65 ...
이 버그는 원격 객체가 예외를 발생하고, 경우 BinaryFormatter를 던졌습니다 XML의 예외를 래핑 IIS된다는 사실에 의해 발생, 진짜 버그가 아닙니다. See this for more info on the bug.
내가 예외를 일으키는 것을 볼 수 없기 때문에 이것은 매우 불행한 일이며 전에는 Remoting을 사용한 적이 없기 때문에 디버깅을 시작할 위치는별로 없다. 공정한 양의 로깅을 수행하고 아무 것도 트리거하지 않는 것으로 보이기 때문에 코드를 실행하기 전에 예외가 발생하는 것 같습니다.
기본적으로, 나는 비슷한 문제가 발생하는 사람들의 몇 가지 단서 또는 포인터를 찾고 있어요 :
어떤 코드가 닷넷 2에서 닷넷 4 컴파일 외에 변경되었습니다 때 예외가 원인이 될 수 무엇- ?
- 반환되는 전체 예외 메시지는 어떻게받을 수 있습니까? 여기
필요에 따라 좀 더 정보를 제공 할 수있는 원격 객체를
Dim clientProvider As BinaryClientFormatterSinkProvider = New BinaryClientFormatterSinkProvider()
Dim serverProvider As BinaryServerFormatterSinkProvider = New BinaryServerFormatterSinkProvider()
serverProvider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full
tsChannelName = System.Guid.NewGuid().ToString()
Dim props As IDictionary = New Hashtable()
props("port") = 0
props("name") = tsChannelName
props("typeFilterLevel") = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full
props("secure") = True
props("useDefaultCredentials") = True
Dim Channel As HttpChannel = New HttpChannel(props, clientProvider, serverProvider)
ChannelServices.RegisterChannel(Channel, False)
//Get the object on the Server
Dim rtnComm As I_CMQCComm = Activator.GetObject(GetType(I_CMQCComm), server)
//Knock knock
rtnComm.IsAlive() 'Exception is thrown here
를 얻는 코드입니다.
.Net 4 용 클라이언트 코드도 컴파일 했습니까? –
예! 또한 ASP.NET 4에서 실행되도록 IIS가 변경되었습니다. Formatter에서 Soap으로 변경하여 정확한 오류를 볼 수있었습니다. 나는 그 문제를 해결하기 위해 막 관리했다. 나는 대답을 게시 할 것이다 :) – Alexandre