merge main branch

This commit is contained in:
CXWTool Service Account
2022-02-18 06:01:46 +00:00
3 changed files with 30 additions and 10 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ on:
env: env:
DOTNET_INSTALLER_CHANNEL: '6.0' DOTNET_INSTALLER_CHANNEL: '6.0'
DOTNET_DO_INSTALL: 'true' DOTNET_DO_INSTALL: 'false'
EnableNuGetPackageRestore: 'True' EnableNuGetPackageRestore: 'True'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel # A workflow run is made up of one or more jobs that can run sequentially or in parallel
@@ -18,7 +18,7 @@ jobs:
# This workflow contains a single job called "snippets-build" # This workflow contains a single job called "snippets-build"
snippets-build: snippets-build:
# The type of runner that the job will run on # The type of runner that the job will run on
runs-on: windows-latest runs-on: windows-2022
permissions: permissions:
statuses: write statuses: write
@@ -31,10 +31,11 @@
None None
.NOTES .NOTES
Version: 1.3 Version: 1.5
Author: adegeo@microsoft.com Author: adegeo@microsoft.com
Creation Date: 07/02/2020 Creation Date: 12/11/2020
Purpose/Change: Add support for config file. Select distinct on project files. Update Date: 02/17/2022
Purpose/Change: Move to VS 2022.
#> #>
[CmdletBinding()] [CmdletBinding()]
@@ -147,13 +148,30 @@ foreach ($item in $workingSet) {
Write-Host "- Using visual studio as build host" Write-Host "- Using visual studio as build host"
# Create the visual studio build command # Create the visual studio build command
"CALL `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat`"`n" + "CALL `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat`"`n" +
"msbuild.exe `"$projectFile`" -restore:True" ` "msbuild.exe `"$projectFile`" -restore:True" `
| Out-File ".\run.bat" | Out-File ".\run.bat"
} }
elseif ($settings.host -eq "custom") {
Write-Host "- Using custom build host: $($settings.command)"
$ExecutionContext.InvokeCommand.ExpandString($settings.command) | Out-File ".\run.bat"
}
elseif ($settings.host -eq "dotnet") {
Write-Host "- Using dotnet build host"
"dotnet build `"$projectFile`"" | Out-File ".\run.bat"
}
else {
throw "snippets.5000.json file isn't valid."
}
} }
$result = Invoke-Expression ".\run.bat" | Out-String Write-Host "run.bat contents: "
Get-Content .\run.bat | Write-Host
Write-Host
Invoke-Expression ".\run.bat" | Tee-Object -Variable "result"
$thisExitCode = 0 $thisExitCode = 0
if ($LASTEXITCODE -ne 0) { if ($LASTEXITCODE -ne 0) {
@@ -172,7 +190,7 @@ foreach ($item in $workingSet) {
# Too many projects found # Too many projects found
elseif ([int]$data[0] -eq 2) { elseif ([int]$data[0] -eq 2) {
New-Result $data[1] $data[2] 2 "😕 Too many projects found. A single project or solution must existing in this directory or one of the parent directories." New-Result $data[1] $data[2] 2 "😕 Too many projects found. A single project or solution must exist in this directory or one of the parent directories."
$thisExitCode = 2 $thisExitCode = 2
} }
@@ -211,6 +211,8 @@ In this section, you'll add two pages and an image to the application.
2. In the **Add Existing Item** dialog, set the file filter to either **All Files** or **Image Files**, browse to the image file you want to use, and then select **Add**. 2. In the **Add Existing Item** dialog, set the file filter to either **All Files** or **Image Files**, browse to the image file you want to use, and then select **Add**.
3. Select the image file in **Solution Explorer**, then in the **Properties** window, set **Build Action** to **Resource**.
## Build and run the application ## Build and run the application
1. To build and run the application, press **F5** or select **Start Debugging** from the **Debug** menu. 1. To build and run the application, press **F5** or select **Start Debugging** from the **Debug** menu.