17

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?

  • VS may have to use the file. I don't see the issue in having the file in there. you can always set up a publish which is not going to have the file. does it show after publish? – Neville Nazerane Feb 04 '18 at 05:03
  • 1
    @NevilleNazerane, the reason we don't want it to be there is because we have more than 100 check-in policies for the sake of quality, and it usually messes with those policies. Sure it's not preventive for our work, but continuous improvement's spirit suggests that we do improvements always and in all sizes. – mohammad rostami siahgeli Feb 04 '18 at 05:33
  • well if you are talking about tfs, i guess you can remove it from source or exclude from project (can't recreate the file with it still on server). Also won't emptying of the file help? because it seems like something like .csproj file that vs requires – Neville Nazerane Feb 04 '18 at 05:42
  • Possible duplicate of [How can I disable the IIS Express launch profile for ASP.NET Core?](https://stackoverflow.com/questions/42382317/how-can-i-disable-the-iis-express-launch-profile-for-asp-net-core) – Neville Nazerane Feb 04 '18 at 05:44

1 Answers1

18

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

Leon V
  • 541
  • 5
  • 12