Skip to content

Commit 26bf721

Browse files
AaronRobinsonMSFTgewarrenRageking8
authored
Update C++/CLI section with compatibility notes (#5735)
* Update C++/CLI section with compatibility notes * Apply suggestions from code review Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Co-authored-by: Rageking8 <tomleetyt@gmail.com> --------- Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Co-authored-by: Rageking8 <tomleetyt@gmail.com>
1 parent 502b349 commit 26bf721

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/dotnet/dotnet-programming-with-cpp-cli-visual-cpp.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ helpviewer_keywords: ["programming [C++], .NET programming", ".NET Framework [C+
66
---
77
# .NET programming with C++/CLI
88

9+
> [!IMPORTANT]
10+
> C++/CLI is a technology designed during the early years of .NET (2003–2010) and remains supported for compatibility purposes. It's best suited for existing codebases, particularly those being brought forward from .NET Framework to .NET Core, or for maintaining large legacy systems that are unlikely to evolve beyond .NET Framework.
11+
>
12+
> While C++/CLI is reliable and robust, no new feature work is planned beyond what's necessary to ensure continued functionality. Developers should be aware that using C++/CLI pessimizes both C++ and .NET languages, as it's constrained by the language features and APIs available at the time of its design—that is, prior to ISO C++11 and .NET Core. C++/CLI was designed based on C++98, and its [ECMA standard](https://ecma-international.org/publications-and-standards/standards/ecma-372) hasn't been updated to keep up with newer C++ standards since C++11. While some features in C++11 were incorporated, many features from more recent standards, like C++20 and C++23, have no direct support in C++/CLI for compilation to managed code. For more information, see [C++20 Support Comes To C++/CLI](https://devblogs.microsoft.com/cppblog/cpp20-support-comes-to-cpp-cli/).
13+
>
14+
> For new projects, we recommend exploring modern third-party alternatives such as <https://github.com/dotnet/ClangSharp> or <https://www.swig.org/>, which offer more flexibility and better alignment with current language and runtime capabilities.
15+
916
C++/CLI supplanted Managed C++. C++/CLI is a language specification created by Microsoft that extends C++ to support .NET. It's only supported on Windows. It's not for writing [WinUI](/windows/apps/winui) or Universal Windows Platform [UWP](/windows/uwp/get-started/universal-application-platform-guide) Windows Runtime (WinRT) apps. It's for writing .NET applications and components that run on .NET. C++/CLI is a bridge between native C++ code and managed code. It allows you to use existing C++ libraries in .NET applications and to write new .NET applications in C++.
1017

1118
Microsoft provides C++/WinRT for writing WinUI and WinRT apps. It's an entirely standard modern C++17 language projection for Windows Runtime (WinRT) APIs. For more information about using C++ with the Windows Runtime (WinRT), see [C++/WinRT](/windows/uwp/cpp-and-winrt-apis/).

0 commit comments

Comments
 (0)