I suggest you ...

Prevent IIS Express from taking over as the launch settings default in .NET Core projects in VS 2017

While debugging ASP.NET Core apps in VS 2017, IIS Express is added as the default in the launch configuration window, backed by `Properties/launchSettings.json`.

If this is changed, or if the settings are removed - either from the UI, or by modifying the file, on the next launch of VS, these settings have been returned, and IIS Express set to the default again.

The issue is compounded when you have a multi-startup solution. In my current case, I have a micro-services solutions with 8 startup projects, with more to follow.

It's getting harder and harder to use VS as the primary debugging platform as this solution grows.

I think this also ties in with a better launch/ configuration experience for multi-startup solutions. Being able to select what launch settings and projects to launch from a single dialog would make the debugging experience substantially better.

41 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Kieron shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

4 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • markgmarkg commented  ·   ·  Flag as inappropriate

    Debugging multiple web projects with "non-IIS" profiles is quite impossible, when using "multiple startup projects" !!!

    The first project is being launched with correct profile, and others with default IIS profile.

  • Kieron commented  ·   ·  Flag as inappropriate

    As it currently stands, I have a ./Scripts/ folder under the solution root, and I run this whenever it forces IIS Express back or I restart VS.

    RemoveISSExpressFromLaunchSettings.ps1:

    Function RemoveFromFile{
    param(
    [string]$File
    )

    $launchSettingContent = Get-Content -Raw -Path $File | ConvertFrom-Json;
    $launchSettingContent.PSObject.Properties.Remove("iisSettings");
    $launchSettingContent.profiles.PSObject.Properties.Remove("IIS Express");

    $jsonContent = ($launchSettingContent | ConvertTo-Json -Depth 100 );

    #Write-Host $jsonContent;

    Set-Content -Path $File $jsonContent;
    }

    $currentFolder = Get-Location;
    $currentFolder = (Get-Item $currentFolder).Parent;

    $launchConfigs = Get-ChildItem -Path $currentFolder.FullName -Filter "*launchsettings.json" -File -Recurse;

    $launchConfigs | ForEach-Object {
    RemoveFromFile -File $_.FullName;
    };

Feedback and Knowledge Base