public void LoadFile(string scriptFile) { try { using (GetPushRuntime()) { var assemblyStream = new BinaryReader(new FxStreamWrapper(m_scriptHost.OpenHostFile(scriptFile))); var assemblyBytes = assemblyStream.ReadBytes((int)assemblyStream.BaseStream.Length); byte[] symbolBytes = null; try { var symbolStream = new BinaryReader(new FxStreamWrapper(m_scriptHost.OpenHostFile(scriptFile + ".mdb"))); symbolBytes = symbolStream.ReadBytes((int)symbolStream.BaseStream.Length); } catch { // nothing } m_intManager.CreateAssembly(assemblyBytes, symbolBytes); } } catch (Exception e) { Debug.WriteLine(e.ToString()); throw; } }
Assembly LoadAssembly(string name) { try { var assemblyStream = new BinaryReader(new FxStreamWrapper(ms_scriptHost.OpenHostFile(name + ".dll"))); var assemblyBytes = assemblyStream.ReadBytes((int)assemblyStream.BaseStream.Length); byte[] symbolBytes = null; try { var symbolStream = new BinaryReader(new FxStreamWrapper(ms_scriptHost.OpenHostFile(name + ".dll.mdb"))); symbolBytes = symbolStream.ReadBytes((int)symbolStream.BaseStream.Length); } catch { // nothing } return(CreateAssemblyInternal(assemblyBytes, symbolBytes)); } catch { } return(null); }
public fxIStream OpenHostFile([MarshalAs(UnmanagedType.LPStr)] string fileName) { return(new WrapIStream(m_realHost.OpenHostFile(fileName))); }