CKTIS / C#
System.Reflection.Assembly: referência prática
System.Reflection.Assembly: referência prática: Assembly representa uma unidade .NET carregada de código e metadados.
Versão: .NET API; verified against .NET 10 reference surface
Sintaxe
System.Reflection.Assembly /* select a documented member or constructor */Assembly representa uma unidade .NET carregada de código e metadados.
Usa-o para inspecionar tipos, recursos e o nome do assembly atual.
O carregamento dinâmico arrisca executar código e criar conflitos de contexto de carregamento.
Location pode estar vazio e GetTypes pode lançar ReflectionTypeLoadException.
O programa completo usa realmente System.Reflection.Assembly; o stdout exato esperado é System.Private.CoreLib.
Exemplos
using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
using Number = System.Int32;
var assembly = typeof(string).Assembly;
Console.WriteLine(assembly.GetName().Name);
Resultado
System.Private.CoreLib
O programa completo usa realmente `System.Reflection.Assembly`; o stdout exato esperado é `System.Private.CoreLib`.