Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent launchSettings.json from being created in Visual Studio 2017

VS 2017 creates a file for ASP.NET Core MVC projects, called launchSettings.json, which contains information about IIS Express and Kestrel AMAIK.

We host our projects in IIS even on development machines, thus we don't really need these files.

We delete them, yet they keep coming back and each time we open up a solution, they show up.

Is there a way to prevent VS from creating those files?

like image 385
mohammad rostami siahgeli Avatar asked Feb 04 '18 04:02

mohammad rostami siahgeli


People also ask

Do I need launchSettings JSON?

The most important point that you need to keep in mind is this launchSettings. json file is only used within the local development machine. That means this file is not required when we publishing our asp.net core application to the production server.

Where is launchSettings JSON Visual Studio?

This file is the same configuration file that you can use when running Visual Studio on Windows or from the command line through dotnet . This file is stored in your project under the Properties folder.

Where is launchSettings JSON located?

json launchSettings. json, which is placed in the Properties folder of a project, describes how the application can be launched — the command to execute, whether the browser should be opened, which environment variables should be set, and so on.

Is launchSettings JSON used in production?

Visual studio maintains a file called launchSettings. json in a folder called Properties. This file contains various options for launching your app. launchSettings is used only by visual studio - it is never deployed to a production server.


Video Answer


1 Answers

As per https://developercommunity.visualstudio.com/comments/652195/view.html - just add the following property to the .csproj: <NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>

like image 56
Leon V Avatar answered Oct 20 '22 16:10

Leon V