diff --git a/.gitignore b/.gitignore index c8259cf33..9cdda77f5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ bin/ obj/ +debug/ project.lock.json *-tests.xml diff --git a/.vscode/launch.json b/.vscode/launch.json index 59b831f29..afd0d5d0b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,8 +7,8 @@ "request": "launch", "justMyCode": false, "stopAtEntry": true, - "program": "${workspaceRoot}/bin/powershell", - "args": [ ], + "program": "${workspaceRoot}/debug/powershell", + "args": [ "-NonInteractive" ], "preLaunchTask": "build", "cwd": "${workspaceRoot}" }, diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 9864ad2b4..3c853f8aa 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -8,7 +8,7 @@ "tasks": [ { "taskName": "build", - "args": [ "Import-Module ${workspaceRoot}/PowerShellGitHubDev.psm1; Start-PSBuild" ], + "args": [ "Import-Module ${workspaceRoot}/PowerShellGitHubDev.psm1; Start-PSBuild -Output debug" ], "isBuildCommand": true, "problemMatcher": "$msCompile" } diff --git a/PowerShellGitHubDev.psm1 b/PowerShellGitHubDev.psm1 index 3dde4e746..db6a39f78 100644 --- a/PowerShellGitHubDev.psm1 +++ b/PowerShellGitHubDev.psm1 @@ -25,6 +25,7 @@ function Start-PSBuild { param( [switch]$NoPath, [switch]$Restore, + [string]$Output, [Parameter(ParameterSetName='CoreCLR')] [switch]$Publish, @@ -105,7 +106,7 @@ function Start-PSBuild { } # set output options - $OptionsArguments = @{Publish=$Publish; FullCLR=$FullCLR; Runtime=$Runtime} + $OptionsArguments = @{Publish=$Publish; Output=$Output; FullCLR=$FullCLR; Runtime=$Runtime} $script:Options = New-PSOptions @OptionsArguments # setup arguments @@ -115,6 +116,9 @@ function Start-PSBuild { } else { $Arguments += "build" } + if ($Output) { + $Arguments += "--output", (Join-Path $PSScriptRoot $Output) + } $Arguments += "--configuration", $Options.Configuration $Arguments += "--framework", $Options.Framework $Arguments += "--runtime", $Options.Runtime @@ -212,6 +216,7 @@ function New-PSOptions { [string]$Runtime, [switch]$Publish, + [string]$Output, [switch]$FullCLR ) @@ -261,21 +266,25 @@ function New-PSOptions { "powershell.exe" } - # Build the Output path in script scope - $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework) + # Build the Output path + if ($Output) { + $Output = Join-Path $PSScriptRoot $Output + } else { + $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework) - # FullCLR only builds a library, so there is no runtime component - if (-not $FullCLR) { - $Output = [IO.Path]::Combine($Output, $Runtime) + # FullCLR only builds a library, so there is no runtime component + if (-not $FullCLR) { + $Output = [IO.Path]::Combine($Output, $Runtime) + } + + # Publish injects the publish directory + if ($Publish) { + $Output = [IO.Path]::Combine($Output, "publish") + } + + $Output = [IO.Path]::Combine($Output, $Executable) } - # Publish injects the publish directory - if ($Publish) { - $Output = [IO.Path]::Combine($Output, "publish") - } - - $Output = [IO.Path]::Combine($Output, $Executable) - return @{ Top = $Top; Configuration = $Configuration; Framework = $Framework; diff --git a/docs/debugging/README.md b/docs/debugging/README.md index 2994048d1..319c423d6 100644 --- a/docs/debugging/README.md +++ b/docs/debugging/README.md @@ -2,7 +2,7 @@ Debugging ========= VS Code -------- +======= [Experimental .NET Core Debugging in VS Code][core-debug] enables cross-platform debugging with the [Visual Studio Code][vscode] editor. @@ -38,19 +38,32 @@ process named `powershell`, and will attach to it. If you need more fine grained control, replace `processName` with `processId` and provide a PID. (Please be careful not to commit such a change). +Important Note +-------------- + +Debugging is very sensitive to the versions of our .NET Core packages, VS Code, +and the C# extension. + +- Use the VS Code [Insiders][] build +- Use the latest pre-release of the [C# extension][] +- Refer to the pre-release [documentation][] + [core-debug]: https://blogs.msdn.microsoft.com/visualstudioalm/2016/03/10/experimental-net-core-debugging-in-vs-code/ [vscode]: https://code.visualstudio.com/ [OmniSharp]: https://github.com/OmniSharp/omnisharp-vscode [vscclrdebugger]: http://aka.ms/vscclrdebugger +[insiders]: https://code.visualstudio.com/insiders +[C# extension]: https://github.com/OmniSharp/omnisharp-vscode/releases +[documentation]: https://github.com/OmniSharp/omnisharp-vscode/pull/157 corehost --------- +======== The native executable prouduced by .NET CLI will produce trace output if launched with `COREHOST_TRACE=1 ./powershell`. CoreCLR PAL ------------ +=========== The native code in the CLR has debug channels to selectively output information to the console. These are controlled by the diff --git a/src/Microsoft.Management.Infrastructure/project.json b/src/Microsoft.Management.Infrastructure/project.json index c30907ee6..e6ff6d089 100644 --- a/src/Microsoft.Management.Infrastructure/project.json +++ b/src/Microsoft.Management.Infrastructure/project.json @@ -8,7 +8,7 @@ }, "dependencies": { - "Microsoft.Management.Infrastructure.Native": "1.0.0-rc3" + "Microsoft.Management.Infrastructure.Native": "1.0.0-rc4" }, "frameworks": { diff --git a/src/windows-build b/src/windows-build index 674541f74..7144b55bd 160000 --- a/src/windows-build +++ b/src/windows-build @@ -1 +1 @@ -Subproject commit 674541f7444de5be5f8c63e3a2ef2d98739c1943 +Subproject commit 7144b55bdafb71dc91af4f5fb13b6e14904b789f