-
-
Save howellcc/b604091547a543d6b9013c7b0299cbe6 to your computer and use it in GitHub Desktop.
Visual Studio - Disable "Always Start When Debugging"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get-project -all | %{ $_.Properties | ?{ $_.Name -eq "WebApplication.StartWebServerOnDebug" } | %{ $_.Value = $False} } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I've added this as a function in my NuGet PowerShell profile. | |
From the Package Manager Console: | |
PM> $profile # echos path to NuGet_profile.ps1. You may have to create this path and file. | |
Open that file in a text editor and add the following code: | |
function DisableStartOnDebug(){ | |
get-project -all | %{ $_.Properties | ?{ $_.Name -eq "WebApplication.StartWebServerOnDebug" } | %{ $_.Value = $False} } | |
Write-Host "'Always Start When Debugging' has been disabled for all web projects." | |
} | |
To reload your profile with the changes: | |
PM> . $profile | |
To run the function: | |
PM> disablestartondebug | |
Of course you can use a shorter name. Even better would be if it automatically ran it when a solution was opened... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment