Share via

Startup, C++, want C#

Sid Kraft 31 Reputation points
2026-02-14T13:21:24.3066667+00:00

Have Visual Studio 2022, originally set the startup environment to execute C++ code. Want to change the environment to C# code so that I can use the "using System" header. Currently requires the C++ header information. How do I do without re-loading Visual Studio to get the startup environment selection? Sid Kraft

Developer technologies | Visual Studio | Setup
0 comments No comments
{count} vote

3 answers

Sort by: Most helpful
  1. Gade Harika (INFOSYS LIMITED) 2,590 Reputation points Microsoft External Staff
    2026-02-16T12:36:39.4433333+00:00

    Thanks for reaching out. In Visual Studio, the “startup environment” doesn’t determine whether you can use C++ or C#. The language is defined by the project type, not by the startup selection.

    If your current project is a C++ project, you cannot use using System; because that is C# syntax, not C++. There’s no way to switch a C++ project into C# just by changing startup settings.

    What you need to do instead

    Option 1: Add a C# project to the solution (recommended)

    1. Right‑click the solutionAddNew Project
    2. Choose a C# project type (Console App, Class Library, etc.)
    3. Set it as startup:
      • Right‑click the C# project → Set as Startup Project
      1. Now you can use using System; normally.

    Option 2: Create a new C# project If you only need C#, create a new C# project and work there. C++ and C# are separate project types and can’t be switched in place.

    Important clarification

    • You do not need to reload or reinstall Visual Studio
    • You cannot convert a C++ project into C# via startup settings
    • Mixed C++ and C# is supported only as separate projects in the same solution

    Summary: Startup selection only controls which project runs. To use C# (using System;), you must work in a C# project.

    Let me know if you need any further help with this. I will be happy to assist. If you find this helpful, Kindly mark the provided solution as "Accept Answer", so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.


  2. Bruce (SqlWork.com) 83,581 Reputation points Volunteer Moderator
    2026-02-14T17:00:38.4733333+00:00

    The vs editing environment is based the project and file type. To edit a c# file, you need to use a c# type project and the file should be c# type. Also be sure the visual studio workload is installed for the c# project type (web, desktop, console, Maui) and desired runtime version (<net48, net48, net9, net10)

    0 comments No comments

  3. Q&A Assist
    2026-02-14T13:21:32.9533333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To change the startup environment in Visual Studio 2022 from C++ to C#, you can do this without reloading Visual Studio. Here’s how:

    1. Open Visual Studio 2022.
    2. Go to the Tools menu and select Options.
    3. In the Options pane, expand the All Settings section, then navigate to Environment > General.
    4. In the On startup, open dropdown, select the option that suits your needs, such as Start window or Most recent solution.
    5. If you want to create a new C# project, go to File > New > Project, and select a C# template from the available options.
    6. Make sure to include the necessary references in your C# code, such as using System;.

    This will allow you to start working with C# code without needing to reload Visual Studio.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.