Configure for Windows Forms

Bryan Kelly 316 Reputation points
2022-06-23T20:20:17.783+00:00

Windows 11, just installed and still having problems. Visual Studio 2019
The goal is to create a GUI project using Windows Forms. A couple of web sites and tutorials indicate that the starting project should be CLR, Common Language Runtime in case I have that wrong.
Start VS -> Create a new project. Near the top the following three items are selected: C++, Windows, Desktop. In the selection for project type, there are five options:
Windows Desktop Wizard
Windows Desktop Application
Shared Items Project
ATL Project
Makefile Project
And no others.
CLR is not found.
Near the bottom click on Install more tools and features
Among all the options .NET desktop development is checked. I am pretty sure that was included during the original installation. Same for Desktop development with C++. Scroll down and there are no options for CLR. There is nothing in the list that I see a need for.
What have I missed? What must be done to start a Windows Form project?

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,827 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,526 questions
{count} vote

2 answers

Sort by: Most helpful
  1. RLWA32 40,286 Reputation points
    2022-06-23T21:29:38.597+00:00

    Microsoft removed the templates to create Windows Forms Applications from Visual Studio using C++/CLI from all versions after VS2010. The view was that C++/CLI was intended to facilitate interop between managed code (C#, VB.net) and unmanaged C++.

    Microsoft has not devoted the attention or development efforts to C++/CLI similar to what has been done for C#.

    I agree with @David Lowndes recommendation to use C# for a Windows Forms Application. However, if you wish to use C++/CLI and the various workarounds for Windows Forms then set your New Project filters to C++ | Windows | Console. If you did install the support for CLR then you should see the related projects

    1 person found this answer helpful.
    0 comments No comments

  2. Minxin Yu 10,031 Reputation points Microsoft Vendor
    2022-06-24T02:15:57.963+00:00

    Hi, @Bryan Kelly
    Check the option in Visual Studio Installer:
    214497-image.png

    For your reference: .NET programming with C++/CLI

    Best regards,

    Minxin Yu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments