Поделиться через


Compilation.Emit Метод

Определение

Перегрузки

Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, CancellationToken)
Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, CancellationToken)
Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, Stream, IEnumerable<EmbeddedText>, CancellationToken)
Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, Stream, IEnumerable<EmbeddedText>, Stream, CancellationToken)

Отправьте IL для скомпилированного исходного кода в указанный поток.

Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, CancellationToken)

Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
public:
 Microsoft::CodeAnalysis::Emit::EmitResult ^ Emit(System::IO::Stream ^ peStream, System::IO::Stream ^ pdbStream, System::IO::Stream ^ xmlDocumentationStream, System::IO::Stream ^ win32Resources, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::ResourceDescription ^> ^ manifestResources, Microsoft::CodeAnalysis::Emit::EmitOptions ^ options, System::Threading::CancellationToken cancellationToken);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Microsoft.CodeAnalysis.Emit.EmitResult Emit (System.IO.Stream peStream, System.IO.Stream pdbStream, System.IO.Stream xmlDocumentationStream, System.IO.Stream win32Resources, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ResourceDescription> manifestResources, Microsoft.CodeAnalysis.Emit.EmitOptions options, System.Threading.CancellationToken cancellationToken);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Microsoft.CodeAnalysis.Emit.EmitResult Emit (System.IO.Stream peStream, System.IO.Stream? pdbStream, System.IO.Stream? xmlDocumentationStream, System.IO.Stream? win32Resources, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ResourceDescription>? manifestResources, Microsoft.CodeAnalysis.Emit.EmitOptions options, System.Threading.CancellationToken cancellationToken);
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
member this.Emit : System.IO.Stream * System.IO.Stream * System.IO.Stream * System.IO.Stream * seq<Microsoft.CodeAnalysis.ResourceDescription> * Microsoft.CodeAnalysis.Emit.EmitOptions * System.Threading.CancellationToken -> Microsoft.CodeAnalysis.Emit.EmitResult
Public Function Emit (peStream As Stream, pdbStream As Stream, xmlDocumentationStream As Stream, win32Resources As Stream, manifestResources As IEnumerable(Of ResourceDescription), options As EmitOptions, cancellationToken As CancellationToken) As EmitResult

Параметры

peStream
Stream
pdbStream
Stream
xmlDocumentationStream
Stream
win32Resources
Stream
manifestResources
IEnumerable<ResourceDescription>
options
EmitOptions
cancellationToken
CancellationToken

Возвращаемое значение

Атрибуты

Применяется к

Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, CancellationToken)

Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
public:
 Microsoft::CodeAnalysis::Emit::EmitResult ^ Emit(System::IO::Stream ^ peStream, System::IO::Stream ^ pdbStream, System::IO::Stream ^ xmlDocumentationStream, System::IO::Stream ^ win32Resources, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::ResourceDescription ^> ^ manifestResources, Microsoft::CodeAnalysis::Emit::EmitOptions ^ options, Microsoft::CodeAnalysis::IMethodSymbol ^ debugEntryPoint, System::Threading::CancellationToken cancellationToken);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Microsoft.CodeAnalysis.Emit.EmitResult Emit (System.IO.Stream peStream, System.IO.Stream pdbStream, System.IO.Stream xmlDocumentationStream, System.IO.Stream win32Resources, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ResourceDescription> manifestResources, Microsoft.CodeAnalysis.Emit.EmitOptions options, Microsoft.CodeAnalysis.IMethodSymbol debugEntryPoint, System.Threading.CancellationToken cancellationToken);
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
member this.Emit : System.IO.Stream * System.IO.Stream * System.IO.Stream * System.IO.Stream * seq<Microsoft.CodeAnalysis.ResourceDescription> * Microsoft.CodeAnalysis.Emit.EmitOptions * Microsoft.CodeAnalysis.IMethodSymbol * System.Threading.CancellationToken -> Microsoft.CodeAnalysis.Emit.EmitResult
Public Function Emit (peStream As Stream, pdbStream As Stream, xmlDocumentationStream As Stream, win32Resources As Stream, manifestResources As IEnumerable(Of ResourceDescription), options As EmitOptions, debugEntryPoint As IMethodSymbol, cancellationToken As CancellationToken) As EmitResult

Параметры

peStream
Stream
pdbStream
Stream
xmlDocumentationStream
Stream
win32Resources
Stream
manifestResources
IEnumerable<ResourceDescription>
options
EmitOptions
debugEntryPoint
IMethodSymbol
cancellationToken
CancellationToken

Возвращаемое значение

Атрибуты

Применяется к

Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, Stream, IEnumerable<EmbeddedText>, CancellationToken)

Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
public:
 Microsoft::CodeAnalysis::Emit::EmitResult ^ Emit(System::IO::Stream ^ peStream, System::IO::Stream ^ pdbStream, System::IO::Stream ^ xmlDocumentationStream, System::IO::Stream ^ win32Resources, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::ResourceDescription ^> ^ manifestResources, Microsoft::CodeAnalysis::Emit::EmitOptions ^ options, Microsoft::CodeAnalysis::IMethodSymbol ^ debugEntryPoint, System::IO::Stream ^ sourceLinkStream, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::EmbeddedText ^> ^ embeddedTexts, System::Threading::CancellationToken cancellationToken);
public Microsoft.CodeAnalysis.Emit.EmitResult Emit (System.IO.Stream peStream, System.IO.Stream pdbStream, System.IO.Stream xmlDocumentationStream, System.IO.Stream win32Resources, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ResourceDescription> manifestResources, Microsoft.CodeAnalysis.Emit.EmitOptions options, Microsoft.CodeAnalysis.IMethodSymbol debugEntryPoint, System.IO.Stream sourceLinkStream, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.EmbeddedText> embeddedTexts, System.Threading.CancellationToken cancellationToken);
public Microsoft.CodeAnalysis.Emit.EmitResult Emit (System.IO.Stream peStream, System.IO.Stream? pdbStream, System.IO.Stream? xmlDocumentationStream, System.IO.Stream? win32Resources, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ResourceDescription>? manifestResources, Microsoft.CodeAnalysis.Emit.EmitOptions options, Microsoft.CodeAnalysis.IMethodSymbol? debugEntryPoint, System.IO.Stream? sourceLinkStream, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.EmbeddedText>? embeddedTexts, System.Threading.CancellationToken cancellationToken);
member this.Emit : System.IO.Stream * System.IO.Stream * System.IO.Stream * System.IO.Stream * seq<Microsoft.CodeAnalysis.ResourceDescription> * Microsoft.CodeAnalysis.Emit.EmitOptions * Microsoft.CodeAnalysis.IMethodSymbol * System.IO.Stream * seq<Microsoft.CodeAnalysis.EmbeddedText> * System.Threading.CancellationToken -> Microsoft.CodeAnalysis.Emit.EmitResult
Public Function Emit (peStream As Stream, pdbStream As Stream, xmlDocumentationStream As Stream, win32Resources As Stream, manifestResources As IEnumerable(Of ResourceDescription), options As EmitOptions, debugEntryPoint As IMethodSymbol, sourceLinkStream As Stream, embeddedTexts As IEnumerable(Of EmbeddedText), cancellationToken As CancellationToken) As EmitResult

Параметры

peStream
Stream
pdbStream
Stream
xmlDocumentationStream
Stream
win32Resources
Stream
manifestResources
IEnumerable<ResourceDescription>
options
EmitOptions
debugEntryPoint
IMethodSymbol
sourceLinkStream
Stream
embeddedTexts
IEnumerable<EmbeddedText>
cancellationToken
CancellationToken

Возвращаемое значение

Применяется к

Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, Stream, IEnumerable<EmbeddedText>, Stream, CancellationToken)

Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs
Source:
Compilation.cs

Отправьте IL для скомпилированного исходного кода в указанный поток.

public Microsoft.CodeAnalysis.Emit.EmitResult Emit (System.IO.Stream peStream, System.IO.Stream pdbStream = default, System.IO.Stream xmlDocumentationStream = default, System.IO.Stream win32Resources = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ResourceDescription> manifestResources = default, Microsoft.CodeAnalysis.Emit.EmitOptions options = default, Microsoft.CodeAnalysis.IMethodSymbol debugEntryPoint = default, System.IO.Stream sourceLinkStream = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.EmbeddedText> embeddedTexts = default, System.IO.Stream metadataPEStream = default, System.Threading.CancellationToken cancellationToken = default);
public Microsoft.CodeAnalysis.Emit.EmitResult Emit (System.IO.Stream peStream, System.IO.Stream? pdbStream = default, System.IO.Stream? xmlDocumentationStream = default, System.IO.Stream? win32Resources = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ResourceDescription>? manifestResources = default, Microsoft.CodeAnalysis.Emit.EmitOptions? options = default, Microsoft.CodeAnalysis.IMethodSymbol? debugEntryPoint = default, System.IO.Stream? sourceLinkStream = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.EmbeddedText>? embeddedTexts = default, System.IO.Stream? metadataPEStream = default, System.Threading.CancellationToken cancellationToken = default);
member this.Emit : System.IO.Stream * System.IO.Stream * System.IO.Stream * System.IO.Stream * seq<Microsoft.CodeAnalysis.ResourceDescription> * Microsoft.CodeAnalysis.Emit.EmitOptions * Microsoft.CodeAnalysis.IMethodSymbol * System.IO.Stream * seq<Microsoft.CodeAnalysis.EmbeddedText> * System.IO.Stream * System.Threading.CancellationToken -> Microsoft.CodeAnalysis.Emit.EmitResult
Public Function Emit (peStream As Stream, Optional pdbStream As Stream = Nothing, Optional xmlDocumentationStream As Stream = Nothing, Optional win32Resources As Stream = Nothing, Optional manifestResources As IEnumerable(Of ResourceDescription) = Nothing, Optional options As EmitOptions = Nothing, Optional debugEntryPoint As IMethodSymbol = Nothing, Optional sourceLinkStream As Stream = Nothing, Optional embeddedTexts As IEnumerable(Of EmbeddedText) = Nothing, Optional metadataPEStream As Stream = Nothing, Optional cancellationToken As CancellationToken = Nothing) As EmitResult

Параметры

peStream
Stream

Поток, в который будет записана компиляция.

pdbStream
Stream

Поток, в который будут записываться отладочные сведения компиляции. Значение NULL для создания PDB для forego.

xmlDocumentationStream
Stream

Поток, в который будет записана XML-документация компиляции. Null для создания XML-кода forego.

win32Resources
Stream

Поток, из которого будут считываться ресурсы Win32 компиляции (в формате RES). Значение NULL, указывающее на отсутствие. Формат RES начинается с записи ресурса NULL. Обратите внимание, что вызывающий объект отвечает за удаление этого потока, если он предоставлен.

manifestResources
IEnumerable<ResourceDescription>

Список управляемых ресурсов компиляции. Значение NULL, указывающее на отсутствие.

options
EmitOptions

Параметры выдачи.

debugEntryPoint
IMethodSymbol

Отладка точки входа сборки. Маркер метода хранится в созданном потоке PDB.

Когда программа запускается с отладчиком, подключенным отладчиком, помещает первую точку останова в начало метода точки входа отладки. Среда CLR запускает выполнение статического метода Main типа MainTypeName . Когда первая точка останова попадает на шаги отладчика, отладчик выполняет инструкцию по оператору, пока не будет достигнут пользовательский код, пропускает методы, помеченные DebuggerHiddenAttributeи принимая во внимание другие атрибуты отладки.

По умолчанию обе точки входа в исполняемой программе (ConsoleApplication, WindowsApplication, ) WindowsRuntimeApplicationявляются одинаковым методом (Main). Неисполняемая программа не имеет точки входа. Среды выполнения, реализующие пользовательский загрузчик, могут указывать точку входа отладки, чтобы заставить отладчик пропустить сложную логику настраиваемого загрузчика, выполняемую в начале .exe, и, таким образом, улучшить процесс отладки.

В отличие от обычной точки входа, которая ограничена неуниверсарным статическим методом конкретной сигнатуры, нет ограничений на debugEntryPoint метод, отличный от тела метода (extern, interface или абстрактные методы не допускаются).

sourceLinkStream
Stream

Поток, содержащий сведения, связывающие компиляцию с системой управления версиями.

embeddedTexts
IEnumerable<EmbeddedText>

Тексты для внедрения в PDB. Поддерживается только при создании переносимых PDB-файлов.

metadataPEStream
Stream

Поток, в который будут записываться выходные данные только метаданных.

cancellationToken
CancellationToken

Отмена процесса выдачи.

Возвращаемое значение

Применяется к