- Диалоговое окно «Сведения о сборке» Assembly Information dialog box
- Список элементов пользовательского интерфейса UIElement list
- Просмотр кода дизассемблирования в отладчике Visual Studio (C#, C++, Visual Basic, F#) View disassembly code in the Visual Studio debugger (C#, C++, Visual Basic, F#)
- Использование окна дизассемблирования Use the Disassembly window
- View disassembly code in the Visual Studio debugger (C#, C++, Visual Basic, F#)
- Use the Disassembly window
- Директива Assembly T4 T4 Assembly Directive
- Использование директивы Assembly Using the Assembly Directive
- Стандартные сборки Standard Assemblies
- Использование свойств проекта в MSBuild и Visual Studio Using project properties in both MSBuild and Visual Studio
Диалоговое окно «Сведения о сборке» Assembly Information dialog box
Диалоговое окно «Сведения о сборке» используется для указания значений глобальных атрибутов сборки .NET Framework, хранящихся в файле AssemblyInfo, который автоматически создается в проекте. The Assembly Information dialog box is used to specify the values of the .NET Framework global assembly attributes, which are stored in the AssemblyInfo file created automatically with your project. У проектов Visual Basic этот файл находится в узле Мой проект в обозревателе решений (чтобы увидеть его, щелкните Показать все файлы). In Solution Explorer, the AssemblyInfo file is located in the My Project node for Visual Basic projects (click Show All files to view it). У проектов C# он находится в разделе Свойства. For C# projects, it’s located under Properties. Дополнительные сведения см. в разделе Атрибуты (C#). For more information, see Attributes (C#).
Чтобы открыть это диалоговое окно, выберите узел проекта в Обозревателе решений, а затем в меню Проект выберите Свойства. To access this dialog box, select a project node in Solution Explorer, and then, on the Project menu, select Properties. На странице Приложение выберите Сведения о сборке. On the Application page, select the Assembly Information button.
Список элементов пользовательского интерфейса UIElement list
Заголовок Title
Указывает заголовок для манифеста сборки. Specifies a title for the assembly manifest. Соответствует AssemblyTitleAttribute. Corresponds to AssemblyTitleAttribute.
Описание Description
Указывает дополнительное описание для манифеста сборки. Specifies an optional description for the assembly manifest. Соответствует AssemblyDescriptionAttribute. Corresponds to AssemblyDescriptionAttribute.
Компания Company
Указывает имя организации для манифеста сборки. Specifies a company name for the assembly manifest. Соответствует AssemblyCompanyAttribute. Corresponds to AssemblyCompanyAttribute.
Вы можете задать или изменить значение по умолчанию для компании в реестре. You can set or change the default value for Company in the registry. Найдите значение RegisteredOrganization в разделе реестра Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion или Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion в зависимости от используемой версии Windows. Look for the RegisteredOrganization value under the Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion or Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion key, depending on your version of Windows.
Продукт Product
Указывает имя продукта для манифеста сборки. Specifies a product name for the assembly manifest. Соответствует AssemblyProductAttribute. Corresponds to AssemblyProductAttribute.
Авторское право Copyright
Указывает авторские права для манифеста сборки. Specifies a copyright notice for the assembly manifest. Соответствует AssemblyCopyrightAttribute. Corresponds to AssemblyCopyrightAttribute.
Товарный знак Trademark
Указывает товарный знак для манифеста сборки. Specifies a trademark for the assembly manifest. Соответствует AssemblyTrademarkAttribute. Corresponds to AssemblyTrademarkAttribute.
Версия сборки Assembly Version
Задает версию сборки. Specifies the version of the assembly. Соответствует AssemblyVersionAttribute. Corresponds to AssemblyVersionAttribute.
Версия файла File Version
Дает компилятору указание использовать определенный номер версии для ресурса версии файла Win32. Specifies a version number that instructs the compiler to use a specific version for the Win32 file version resource. Соответствует AssemblyFileVersionAttribute. Corresponds to AssemblyFileVersionAttribute.
GUID GUID
Уникальный идентификатор GUID для сборки. A unique GUID that identifies the assembly. При создании проекта Visual Studio создает идентификатор GUID для сборки. When you create a project, Visual Studio generates a GUID for the assembly. Соответствует Guid. Corresponds to Guid.
Нейтральный язык Neutral Language
Указывает, какой язык и региональные параметры поддерживает сборка. Specifies which culture the assembly supports. Соответствует NeutralResourcesLanguageAttribute. Corresponds to NeutralResourcesLanguageAttribute. Значение по умолчанию — (Нет) . The default is (None).
Сделать сборку видимой для COM Make assembly COM-Visible
Указывает, будут ли типы в сборке доступными для модели COM. Specifies whether types in the assembly will be available to COM. Соответствует ComVisibleAttribute. Corresponds to ComVisibleAttribute.
Просмотр кода дизассемблирования в отладчике Visual Studio (C#, C++, Visual Basic, F#) View disassembly code in the Visual Studio debugger (C#, C++, Visual Basic, F#)
В окне Дизассемблированный код отображается код сборки, соответствующий инструкциям, созданным компилятором. The Disassembly window shows assembly code corresponding to the instructions created by the compiler. При отладке управляемого кода эти инструкции ассемблера соответствуют присущему данному объекту коду, созданному компилятором JIT, а не промежуточному языку (MSIL), созданному компилятором Visual Studio. If you’re debugging managed code, these assembly instructions correspond to the native code created by the Just-in-Time (JIT) compiler, not the Microsoft intermediate language (MSIL) created by the Visual Studio compiler.
Чтобы воспользоваться всеми возможностями окна Дизассемблированный код, изучите основы программирования на языке ассемблера. To take full advantage of the Disassembly window, understand or learn the basics of assembly-language programming.
Эта возможность доступна, только если включена отладка на уровне адреса. This feature is only available if address-level debugging is enabled. Она недоступна для отладки скриптов и SQL. It isn’t available for script or SQL debugging.
В дополнение к инструкциям ассемблера в окне Дизассемблированный код могут отображаться следующие сведения: In addition to assembly instructions, the Disassembly window can show the following optional information:
Адреса в памяти, где располагается каждая из инструкций. Memory address where each instruction is located. Для собственных приложений это фактические адреса в памяти. For native applications, it is the actual memory address. Для кода на Visual Basic или C# это смещение относительно начала функции. For Visual Basic or C#, it’s an offset from the beginning of the function.
Исходный код, из которого получается код сборки. Source code from which the assembly code derives.
Байты кода, то есть байтовое представление реальных инструкций компьютера или языка MSIL. Code bytes, that is, the byte representations of the actual machine or MSIL instructions.
Символьные имена для адресов памяти. Symbol names for the memory addresses.
Номера строк, соответствующие исходному коду. Line numbers corresponding to the source code.
Инструкции на языке ассемблера состоят из мнемоник, представляющих собой сокращения имен инструкций, и символов, которые обозначают переменные, регистры и константы. Assembly-language instructions consist of mnemonics, which are abbreviations for instruction names, and symbols for variables, registers, and constants. Каждую инструкцию машинного кода представляет одна мнемоника ассемблера, за которой следует один или несколько необязательных символов. Each machine-language instruction is represented by one assembly-language mnemonic optionally followed by one or more symbols.
Код на ассемблере активно использует регистры процессора, а при использовании управляемого кода — регистры среды выполнения. Assembly code relies heavily on processor registers or, for managed code, common language runtime registers. Вы можете использовать окно Дизассемблированный код в сочетании с окном Регистры, которое позволяет изучить содержимое регистров. You can use the Disassembly window along with the Registers window, which allows you to examine register contents.
Чтобы просмотреть инструкции машинного кода в необработанной числовой форме, а не на языке ассемблера, используйте окно Память или выберите Байты кода в контекстном меню в окне Дизассемблированный код. To view machine-code instructions in their raw numeric form, rather than as assembly language, use the Memory window or select Code Bytes from the shortcut menu in the Disassembly window.
Использование окна дизассемблирования Use the Disassembly window
Чтобы включить окно Дизассемблированный код, выберите в разделе Сервис > Параметры > Отладка параметр Включить отладку на уровне адреса. To enable the Disassembly window, under Tools > Options > Debugging, select Enable address-level debugging.
Чтобы открыть окно Дизассемблированный код во время отладки, выберите Windows > Дизассемблированный код или нажмите сочетание клавиш ALT+8. To open the Disassembly window during debugging, select Windows > Disassembly or press Alt+8.
Отображаемые диалоговые окна и команды меню могут отличаться от описанных в справке в зависимости от текущих параметров или выпуска. The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. Чтобы изменить параметры, выберите в меню Сервис пункт Импорт и экспорт параметров . To change your settings, choose Import and Export Settings on the Tools menu. Дополнительные сведения см. в разделе Сброс параметров. For more information, see Reset settings.
Чтобы включить или отключить вывод дополнительных сведений, щелкните правой кнопкой в окне Дизассемблированный код и установите или снимите в контекстном меню соответствующие флажки. To turn optional information on or off, right-click in the Disassembly window, and set or clear the desired options in the shortcut menu.
Желтая стрелка, расположенная в левом поле, отмечает текущую точку выполнения. A yellow arrow in the left margin marks the current execution point. Для собственного кода точка выполнения соответствует счетчику команд ЦП. For native code, the execution point corresponds to the CPU’s program counter. В этом расположении отображается следующая инструкция, которая будет выполнена в программе. This location shows the next instruction that will be executed in your program.
View disassembly code in the Visual Studio debugger (C#, C++, Visual Basic, F#)
The Disassembly window shows assembly code corresponding to the instructions created by the compiler. If you’re debugging managed code, these assembly instructions correspond to the native code created by the Just-in-Time (JIT) compiler, not the Microsoft intermediate language (MSIL) created by the Visual Studio compiler.
To take full advantage of the Disassembly window, understand or learn the basics of assembly-language programming.
This feature is only available if address-level debugging is enabled. It isn’t available for script or SQL debugging.
In addition to assembly instructions, the Disassembly window can show the following optional information:
Memory address where each instruction is located. For native applications, it is the actual memory address. For Visual Basic or C#, it’s an offset from the beginning of the function.
Source code from which the assembly code derives.
Code bytes, that is, the byte representations of the actual machine or MSIL instructions.
Symbol names for the memory addresses.
Line numbers corresponding to the source code.
Assembly-language instructions consist of mnemonics, which are abbreviations for instruction names, and symbols for variables, registers, and constants. Each machine-language instruction is represented by one assembly-language mnemonic optionally followed by one or more symbols.
Assembly code relies heavily on processor registers or, for managed code, common language runtime registers. You can use the Disassembly window along with the Registers window, which allows you to examine register contents.
To view machine-code instructions in their raw numeric form, rather than as assembly language, use the Memory window or select Code Bytes from the shortcut menu in the Disassembly window.
Use the Disassembly window
To enable the Disassembly window, under Tools > Options > Debugging, select Enable address-level debugging.
To open the Disassembly window during debugging, select Windows > Disassembly or press Alt+8.
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Reset settings.
To turn optional information on or off, right-click in the Disassembly window, and set or clear the desired options in the shortcut menu.
A yellow arrow in the left margin marks the current execution point. For native code, the execution point corresponds to the CPU’s program counter. This location shows the next instruction that will be executed in your program.
Директива Assembly T4 T4 Assembly Directive
В текстовом шаблоне времени разработки Visual Studio assembly директива загружает сборку, чтобы код шаблона мог использовать его типы. In a Visual Studio design-time text template, the assembly directive loads an assembly so that your template code can use its types. Этот результат аналогичен добавлению ссылки на сборку в проекте Visual Studio. The effect is similar to adding an assembly reference in a Visual Studio project.
Общие сведения о создании текстовых шаблонов см. в разделе написание текстового шаблона T4. For a general overview of writing text templates, see Writing a T4 Text Template.
В текстовом шаблоне времени выполнения (предварительно обработанном) директива assembly не требуется. You do not need the assembly directive in a run-time (preprocessed) text template. Вместо этого добавьте необходимые сборки в ссылки проекта Visual Studio. Instead, add the necessary assemblies to the References of your Visual Studio project.
Использование директивы Assembly Using the Assembly Directive
Синтаксис директивы таков: The syntax of the directive is as follows:
Имя сборки должно быть одним из следующих: The assembly name should be one of the following:
Строгое имя сборки в глобальном кэше сборок, такое как System.Xml.dll . The strong name of an assembly in the GAC, such as System.Xml.dll . Кроме того, можно использовать полную форму, такую как name=»System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ . You can also use the long form, such as name=»System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ . Для получения дополнительной информации см. AssemblyName. For more information, see AssemblyName.
абсолютный путь к сборке; The absolute path of the assembly
Синтаксис можно использовать $(variableName) для ссылки на переменные среды Visual Studio, такие как $(SolutionDir) и %VariableName% . You can use the $(variableName) syntax to reference Visual Studio variables such as $(SolutionDir) , and %VariableName% to reference environment variables. Пример: For example:
В предварительно преобразованном текстовом шаблоне директива assembly не производит никакого эффекта. The assembly directive has no effect in a preprocessed text template. Вместо этого включите необходимые ссылки в раздел References проекта Visual Studio. Instead, include the necessary references in the References section of your Visual Studio project. Дополнительные сведения см. в статье Создание текста во время выполнения с помощью текстовых шаблонов T4. For more information, see Run-Time Text Generation with T4 Text Templates.
Стандартные сборки Standard Assemblies
Следующие сборки загружаются автоматически, поэтому для них не нужно создавать директивы сборки: The following assemblies are loaded automatically, so that you do not need to write assembly directives for them:
При использовании пользовательской директивы процессор директив может загружать дополнительные сборки. If you use a custom directive, the directive processor might load additional assemblies. Например, при создании шаблонов для доменного языка (DSL) не требуется создавать директивы сборки для следующих сборок: For example, if you write templates for a domain-specific language (DSL), you do not need to write assembly directives for the following assemblies:
Сборка, содержащая DSL. The assembly containing your DSL.
Использование свойств проекта в MSBuild и Visual Studio Using project properties in both MSBuild and Visual Studio
Макросы Visual Studio, такие как $ (SolutionDir), не работают в MSBuild. Visual Studio macros like $(SolutionDir) don’t work in MSBuild. Если требуется преобразовывать шаблоны на компьютере сборки, необходимо использовать свойства проекта. If you want to transform templates in your build machine, you have to use project properties instead.
Измените CSPROJ- или VBPROJ-файл для определения свойства проекта. Edit your .csproj or .vbproj file to define a project property. В этом примере определяется свойство с именем myLibFolder . This example defines a property named myLibFolder :
Теперь можно использовать свойство проекта в текстовых шаблонах, которые будут правильно преобразовываться как в Visual Studio, так и в MSBuild: Now you can use your project property in text templates, which transform correctly in both Visual Studio and MSBuild: