How to read assembly from stream instead of file in Common Compiler Infrastructure

394 views Asked by At

In CCI, it is possible to load a .NET assembly from file:

var assembly = (IAssembly) new PeReader.DefaultHost().LoadUnitFrom("C:\assembly.dll");

But I can't find any way to load it from any stream. I believe it should be possible because I can easly write assembly to stream:

PeWriter.WritePeToStream(assembly , _host, stream);

PeReader has OpenModule method that takes BinaryDocument parameter. But there is not way to create a BinaryDocument from stream instead of file.

Actually I'm interested in any way to read an assembly using CCI but not using slow file I/O.

0

There are 0 answers