Skip to content

Instantly share code, notes, and snippets.

@joshuaflanagan
Created June 1, 2011 22:23
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save joshuaflanagan/1003503 to your computer and use it in GitHub Desktop.
Save joshuaflanagan/1003503 to your computer and use it in GitHub Desktop.
Turn off Always Start When Debugging for all web projects (run within Nuget powershell console)
get-project -all | %{ $_.Properties | ?{ $_.Name -eq "WebApplication.StartWebServerOnDebug" } | %{ $_.Value = "False"} }
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
Open that file in a text editor and add the following code:
function NoStartOnDebug(){
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> nostartondebug
Of course you can use a shorter name. Even better would be if it automatically ran it when a solution was opened...
@tahazayed
Copy link

Disable Always Start When Debugging visual studio extension
http://visualstudiogallery.msdn.microsoft.com/9ccbf2ee-52a4-4783-a41c-c7057335ce28

@KirillFormado
Copy link

For me is doesn't work. I think is correct $_.Value = $False

@IgorWolbers
Copy link

Brilliant, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment