Skip to content

Commit 7ba6aba

Browse files
committed
Fixed issue generating sample project references
1 parent 0fdb53e commit 7ba6aba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

MultiTarget/GenerateAllProjectReferences.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ New-Item -ItemType Directory -Force -Path $projectPropsOutputDir -ErrorAction Si
1717
foreach ($projectPath in Get-ChildItem -Directory -Path "$PSScriptRoot/../../components/*") {
1818
$srcPath = Resolve-Path "$($projectPath.FullName)\src";
1919
$srcProjectPath = Get-ChildItem -File "$srcPath\*.csproj";
20-
$sampleProjectPath = "$($projectPath.FullName)\samples\*.csproj";
20+
$sampleProjectPath = Get-ChildItem -File "$($projectPath.FullName)\samples\*.csproj" -ErrorAction SilentlyContinue;
2121

2222
# Generate <ProjectReference>s for sample project
2323
# Use source project MultiTarget as first fallback.
24-
if (Test-Path $sampleProjectPath) {
24+
if ($null -ne $sampleProjectPath -and (Test-Path $sampleProjectPath)) {
2525
& $PSScriptRoot\GenerateMultiTargetAwareProjectReferenceProps.ps1 -projectPath $sampleProjectPath -outputPath "$projectPropsOutputDir/$($sampleProjectPath.BaseName).props" -MultiTarget $MultiTarget
2626
}
2727

0 commit comments

Comments
 (0)