Microsoft.Cci.PdbWriter.SetEntryPoint C# (CSharp) Method

SetEntryPoint() public method

public SetEntryPoint ( uint entryMethodToken ) : void
entryMethodToken uint
return void
    public void SetEntryPoint(uint entryMethodToken) {
      this.SymWriter.SetUserEntryPoint(entryMethodToken);
    }

Usage Example

Example #1
0
        public static void WritePeToStream(
            EmitContext context,
            CommonMessageProvider messageProvider,
            Stream peStream,
            PdbWriter nativePdbWriterOpt,
            bool allowMissingMethodBodies,
            bool deterministic,
            CancellationToken cancellationToken)
        {
            var peWriter = new PeWriter(context.Module, nativePdbWriterOpt, deterministic);

            var mdWriter = FullMetadataWriter.Create(context, messageProvider, allowMissingMethodBodies, deterministic, cancellationToken);

            if (nativePdbWriterOpt != null)
            {
                nativePdbWriterOpt.SetMetadataEmitter(mdWriter);
            }

            uint entryPointToken;
            peWriter.WritePeToStream(mdWriter, peStream, nativePdbWriterOpt, out entryPointToken);

            if (nativePdbWriterOpt != null)
            {
                if (entryPointToken != 0)
                {
                    nativePdbWriterOpt.SetEntryPoint(entryPointToken);
                }

                var assembly = context.Module.AsAssembly;
                if (assembly != null && assembly.Kind == ModuleKind.WindowsRuntimeMetadata)
                {
                    // Dev12: If compiling to winmdobj, we need to add to PDB source spans of
                    //        all types and members for better error reporting by WinMDExp.
                    nativePdbWriterOpt.WriteDefinitionLocations(context.Module.GetSymbolToLocationMap());
                }
            }
        }
All Usage Examples Of Microsoft.Cci.PdbWriter::SetEntryPoint