Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When adding new C# projects in Visual Studio, additional configurations are not created automatically [duplicate]

I have a Visual Studio C# solution which I have added a new solution configuration to.

When I create new projects in the solution they have Debug and Release configurations only.

Why do they not have the additional configurations?

like image 648
haymansfield Avatar asked May 02 '13 09:05

haymansfield


People also ask

Can you include .C files in C?

You can properly include . C or . CPP files into other source files.

Can you write C in Visual Studio?

The Microsoft C/C++ for Visual Studio Code extension supports IntelliSense, debugging, code formatting, auto-completion. Visual Studio for Mac doesn't support Microsoft C++, but does support . NET languages and cross-platform development.

Can I run C program in Android?

You can add C and C++ code to your Android project by placing the code into a cpp directory in your project module. When you build your project, this code is compiled into a native library that Gradle can package with your app.


1 Answers

Understanding Build Configurations says:

By default, projects created with Visual Studio include Debug and Release configurations. Debug configurations are automatically configured for debugging an application, and Release configurations are configured for the final release of an application.

So, basically, every time you add a new project to the solution, you choose the type of your new Visual Studio project from a set of preexisting project templates, which only have the Debug and Release configurations.

Visual Studio allows you to export your own project templates and use them subsequently for creating new projects.

What you can do is:

  1. Create a new empty project of the type that you need to create (Class Library, Console Application etc).
  2. Add the desired project configuration to this project (let's name it Test).
  3. Export the template after naming it MyTemplate. Also make sure that the Automatically import the template into Visual Studio checkbox is checked.
  4. Go back to your original solution and add the project by choosing it from the list of available templates - MyTemplate (which now will be listed).

You will have the Test available as a custom project configuration.

[UPDATE]

Alternatively, you should know that it's also possible to create your own Visual Studio Add-ins which could give you more freedom for creating projects based on templates and for automating builds. Check out the following examples:

How to: Programmatically Create Projects

How to: Create Solution and Project Build Configurations

like image 198
Alex Filipovici Avatar answered Nov 12 '22 12:11

Alex Filipovici