のServiceContract & OperationContractは以下のようになります。WCFでタイプ "アセンブリ"を返す方法は?
[ServiceContract]
public interface IAssemblyResolver
{
[OperationContract]
Assembly LoadAssembly(AssemblyLoadRequest loadRequest);
// TODO: Add your service operations here
}
タイプAssembly
を戻しながら、私は、トレースログ内のエラーの下に取得する:クライアント側で
There was an error while trying to serialize parameter http://tempuri.org/:LoadAssemblyResult . The InnerException message was 'Type 'System.Reflection.RuntimeAssembly' with data contract name 'RuntimeAssembly: http://schemas.datacontract.org/2004/07/System.Reflection ' is not expected. Consider using a DataContractResolver if you are using DataContractSerializer or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to the serializer.'. Please see InnerException for more details.
私はエラーの下に出る:
Additional information: An error occurred while receiving the HTTP response to http://localhost:8769/AssemblyResolverService.svc . This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
dllバイナリを返すのですか? – Wojtpl2
あなたがしようとしていることを説明してください。これはうまくいかないようです。 WCFサービスがクライアントのDLLをホストするようにするには、DLLとその依存関係をクライアントにストリーミングする必要があります。 – CodeCaster
共有場所からアセンブリを読み込み、単純にそれを返すことにしました。 – Amit