コード例 #1
0
        public void Save(CciAssembly assembly, string path)
        {
            Contract.Requires(assembly != null);
            Contract.Requires(!string.IsNullOrEmpty(path));

            var sourceLocationProvider = GetPdbReader(assembly.Module);

            lock (turnstile)
            {
                ContractHelper.InjectContractCalls(host, assembly.Module, assembly.ContractProvider, sourceLocationProvider);
            }
            using (var peStream = File.Create(path))
            {
                lock (turnstile)
                {
                    PeWriter.WritePeToStream(assembly.Module, host, peStream);
                }
            }
        }