Skip to content

Commit 7e6a34a

Browse files
Fix NETSDK1194 warning
- Fix NETSDK1194 warning introduced by #1374. - Set `MSBuildTreatWarningsAsErrors=true`.
1 parent 75976a7 commit 7e6a34a

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<GenerateDocumentationFile>false</GenerateDocumentationFile>
1010
<ImplicitUsings>enable</ImplicitUsings>
1111
<LangVersion>latest</LangVersion>
12+
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>
1213
<NeutralLanguage>en-US</NeutralLanguage>
1314
<Nullable>enable</Nullable>
1415
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>

build.ps1

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ if ($installDotNetSdk -eq $true) {
7979
}
8080

8181
function DotNetTest {
82-
param()
82+
param([string]$Project)
8383

8484
$additionalArgs = @()
8585

@@ -88,7 +88,7 @@ function DotNetTest {
8888
$additionalArgs += "GitHubActions;report-warnings=false"
8989
}
9090

91-
& $dotnet test --output $OutputPath --configuration $Configuration $additionalArgs
91+
& $dotnet test $Project --output $OutputPath --configuration $Configuration $additionalArgs
9292

9393
if ($LASTEXITCODE -ne 0) {
9494
throw "dotnet test failed with exit code $LASTEXITCODE"
@@ -110,13 +110,18 @@ $publishProjects = @(
110110
(Join-Path $solutionPath "src" "TodoApp" "TodoApp.csproj")
111111
)
112112

113+
$testProjects = @(
114+
(Join-Path $solutionPath "tests" "TodoApp.Tests" "TodoApp.Tests.csproj")
115+
)
116+
113117
Write-Output "Publishing solution..."
114118
ForEach ($project in $publishProjects) {
115119
DotNetPublish $project $Configuration
116120
}
117121

118122
if (-Not $SkipTests) {
119-
Write-Output "Testing solution..."
120-
DotNetTest
123+
Write-Host "Testing $($testProjects.Count) project(s)..." -ForegroundColor Green
124+
ForEach ($project in $testProjects) {
125+
DotNetTest $project
126+
}
121127
}
122-

0 commit comments

Comments
 (0)