使用 C++/CLI (Visual C++) 进行 .NET 编程.NET Programming with C++/CLI (Visual C++)

Visual Studio 2015:默认情况下,使用 Visual Studio 2015 创建的 CLR 项目将以.NET Framework 4.5.2 为目标。Visual Studio 2015: By default, CLR projects created with Visual Studio 2015 target .NET Framework 4.5.2. 若要在创建新项目时将目标设定为 .NET Framework 4.6,请在“新建项目” 对话框中,更改该对话框顶部中间的下拉列表中的目标框架。To target .NET Framework 4.6 when you create a new project, in the New Project dialog, change the target framework in the dropdown at the top middle of the dialog. 若要更改现有项目的目标框架,请关闭项目、编辑项目文件 (.vcxproj),并将目标 Framework 版本的值更改为 4.6。To change the target framework for an existing project, close the project, edit the project file (.vcxproj), and change the value of the Target Framework Version to 4.6. 设置将在你下次打开该项目时生效。Next time you open the project, the settings will take effect.

Visual Studio 2017:在 Visual Studio 2017 中,默认框架是 4.6.1 和 Framework 版本选择器是在底部新建项目对话框Visual Studio 2017: In Visual Studio 2017, the default framework is 4.6.1 and the Framework version selector is at the bottom of the New Project Dialog. C++/ 默认情况下未安装 CLI 本身。C++/CLI itself is not installed by default. 若要安装组件,请打开 Visual Studio 安装程序并选择C++/CLI 组件下视觉对象C++。To install the component, open the Visual Studio Installer and choose the C++/CLI component under Visual C++.

本节内容In This Section

C++/CLI 任务C++/CLI Tasks

本机和 .NET 的互操作性Native and .NET Interoperability

C++/CLI 迁移入门C++/CLI Migration Primer

纯代码和可验证代码 (C++/CLI)Pure and Verifiable Code (C++/CLI)

正则表达式 (C++/CLI)Regular Expressions (C++/CLI)

文件处理和 I/O (C++/CLI)File Handling and I/O (C++/CLI)

图形操作 (C++/CLI)Graphics Operations (C++/CLI)

Windows 操作 (C++/CLI)Windows Operations (C++/CLI)

使用 ADO.NET 的数据访问 (C++/CLI)Data Access Using ADO.NET (C++/CLI)

与其他 .NET 语言的互操作性 (C++/CLI)Interoperability with Other .NET Languages (C++/CLI)

序列化 (C++/CLI)Serialization (C++/CLI)

托管类型 (C++/CLI)Managed Types (C++/CLI)

反射 (C++/CLI)Reflection (C++/CLI)

强名称程序集(程序集签名)(C++/CLI)Strong Name Assemblies (Assembly Signing) (C++/CLI)

Debug 类 (C++/CLI)Debug Class (C++/CLI)

STL/CLR 库参考STL/CLR Library Reference

C++ 支持库C++ Support Library

C++/CLI 中的异常Exceptions in C++/CLI

装箱 (C++/CLI)Boxing (C++/CLI)

请参阅See also

本机和 .NET 的互操作性Native and .NET Interoperability