Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Castle Dynamic Proxy基本クラスやインターフェイスがなくても、一般的なライブラリを使用して動的プロキシを作成することは可能ですか?実行時に動的なオンザフライクラスを作成することに本当に興味があります。
Castle Dynamic Proxy
確かに、Reflection.Emitを使用してインターフェイスをベイクし、生成されたインターフェイスタイプをCreateInterfaceProxyWithoutTargetインターセプターに渡して提供します。
CreateInterfaceProxyWithoutTarget
タイプをアンロードすることはできず、appdomainのみをアンロードできることを覚えておいてください。したがって、何千ものタイプを作成しようとすると、パフォーマンスが低下する可能性があります。