Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create a C++ console app using the `dotnet` CLI

I ran a dotnew new list command but found no templates with C++ as a language.

This documentation also mentions a CLI, but I think it might be something else in that context.

Is it possible to use the dotnet CLI to create a C++ console application for Visual Studio? If not, then why not?

like image 931
user32882 Avatar asked Jun 10 '26 00:06

user32882


1 Answers

C++/CLI is still supported with VS2022 (both with .NET Framework, but also with .NET 6.0+), but with one significant limitation: Only libraries can be built with C++/CLI, because it's main use is to write wrapper libraries between native libraries and C# applications. Therefore, you won't find an application template (neither command line nor windowed) any more, because C++/CLI projects can't be applications. You always need a C# (or VB, if you want) project as startup project.

Two "Empty CLR project" templates exist for creating a C++/CLI project, for .NET framework and .NET respectively.

like image 92
PMF Avatar answered Jun 11 '26 14:06

PMF



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!