Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 and 2019 C++/CLI Missing

I can't understand why I can't find C++/CLI project type in to Visual Studio 2017. I just updated my Visual Studio, and now I can't create any more Windows Forms applications.

Visual Studio 2017 Project Options

Packages installed

like image 571
Zero Memory DLL Avatar asked Apr 08 '17 18:04

Zero Memory DLL


People also ask

What is the difference between C++ and C++/CLI?

C++ runs directly as binary complied for your hardware. C++ cli is a c++ extension that is used to interface with the MS common language runtime. It complies to IL normally and is executed inside the . net runtime.

What does C++/CLI stand for?

C++/CLI is variant of the C++ programming language, modified for Common Language Infrastructure.

How do I enable CLR in Visual Studio?

In the Visual Studio IDE, the /clr compiler option can be individually set on the Configuration Properties > C/C++ > General page of the Property Pages dialog.


2 Answers

Valid for visual studio 2017,2019,2022

The answer is solved in this visual studio community forum.

I copied the solution here for convenience:

Please make sure you have selected the component "C++/CLI support" in your installation;

  1. Please launch the "Visual Studio Installer"
  2. Modify your installed VS;
  3. You can find the component "C++/CLI support" under thw workload "Desktop development with C++"

Package to install using Visual Studio 2017

like image 58
gavioto Avatar answered Nov 18 '22 01:11

gavioto


First, Microsoft implementation of C++/CLI is called CLR so you want to look for CLR project type when creating new project.

Second, it's an optional component in Visual Studio 2017.

From the link:

In Visual Studio 2017 and later, C++/CLI support is an optional component. To install it, open the Visual Studio Installer from the Windows Start menu. Make sure that the Desktop development with C++ tile is checked, and in the Optional components section, also check C++/CLI Support.

The 2nd screen shot you have shared, go to individual components tab and select C++/CLI option (that's how it appears there).

I haven't not tested this for VS2017 but I did test it for VS2019 and that's what needs to be done. I am pretty sure it's the same for both visual studios.

Here is the screenshot for VS2019.

enter image description here

like image 2
zar Avatar answered Nov 18 '22 01:11

zar