Skip to content

Commit 9ebee33

Browse files
shyamnamboodiripadfabiocav
authored andcommitted
Stop popping up console windows during programmatic builds
Changes GenerateFunctionsExtensionsMetadata MSBuild task to avoid popping up console window for dotnet.exe during programmatic builds launched from within processes that don't have a console window. If the launching process has an associated console window (e.g. when MSBuild is launched from command line), CreateNoWindow = false has no effect. However, if the launching process does not have an allocated console window (which is what happens in the case of the Live Unit Testing feature in VS) then setting CreateNoWindow = false ends up popping up console window for the child dotnet.exe process. This is particularly problematic for Live Unit Testing. Live Unit Testing constantly performs builds in the background as the user changes their code in the VS editor. Without this fix, any code change that requires to rebuild an Azure Functions project in the user's solution results in popping up the above console window. The repeated pop ups end up impeding the user's ability to type in the editor. Since standard input and output are already being redirected, the popup console window was not particularly helpful anyways. I suspect the original intention of this code may have been to set CreateNoWindow = true and that it may have been set to false inadvertently.
1 parent 2efc384 commit 9ebee33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/ExtensionsMetadataGenerator/src/ExtensionsMetadataGenerator/BuildTasks/GenerateFunctionsExtensionsMetadata.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public override bool Execute()
3737
var info = new ProcessStartInfo
3838
{
3939
UseShellExecute = false,
40-
CreateNoWindow = false,
40+
CreateNoWindow = true,
4141
RedirectStandardError = true,
4242
RedirectStandardOutput = true,
4343
WorkingDirectory = Path.Combine(Path.GetDirectoryName(taskAssembly.Location), "..", "netstandard2.0", "generator"),

0 commit comments

Comments
 (0)