Я искал немного через ссылки на сборки и заметил странный комментарий/сниппет:Как настроить таргетинг на модуль?
// Attribute class used by the compiler to mark modules.
// If present, then debugging information for everything in the
// assembly was generated by the compiler, and will be preserved
// by the Runtime so that the debugger can provide full functionality
// in the case of JIT attach. If not present, then the compiler may
// or may not have included debugging information, and the Runtime
// won't preserve the debugging info, which will make debugging after
// a JIT attach difficult.
[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Module, AllowMultiple = false)]
[ComVisible(true)]
public sealed class DebuggableAttribute : Attribute
{
Теперь я прыгал на AttributeTargets
и интересно, что модуль находится в C#/NET..
[Flags]
[ComVisible(true)]
[__DynamicallyInvokable]
[Serializable]
public enum AttributeTargets
{
[__DynamicallyInvokable] Assembly = 1,
[__DynamicallyInvokable] Module = 2,
[__DynamicallyInvokable] Class = 4,
[__DynamicallyInvokable] Struct = 8,
[__DynamicallyInvokable] Enum = 16,
[__DynamicallyInvokable] Constructor = 32,
[__DynamicallyInvokable] Method = 64,
[__DynamicallyInvokable] Property = 128,
[__DynamicallyInvokable] Field = 256,
[__DynamicallyInvokable] Event = 512,
[__DynamicallyInvokable] Interface = 1024,
[__DynamicallyInvokable] Parameter = 2048,
[__DynamicallyInvokable] Delegate = 4096,
[__DynamicallyInvokable] ReturnValue = 8192,
[__DynamicallyInvokable] GenericParameter = 16384,
[__DynamicallyInvokable] All = GenericParameter | ReturnValue | Delegate | Parameter | Interface | Event | Field | Property | Method | Constructor | Enum | Struct | Class | Module | Assembly,
}
Так что мой вопрос: как настроить таргетинг модуля на код C# с помощью атрибута?
Этот атрибут уже выдается компилятором. Никогда не пишите это сами, ошибаясь, имеет * очень * вредные побочные эффекты. –
@ HansPassant хорошо – Mafii