Skip to content

Commit 38c3c66

Browse files
authored
Add assembly reference for System.Net.ServerSentEvents to Export-Api.ps1 script (#757)
With the new dependency on System.Net.ServerSentEvents, the Export-Api.ps1 script now shows the following warning: > CP1002: Could not resolve reference 'System.Net.ServerSentEvents.dll' in any of the provided search directories. To address this warning, this change adds System.Net.ServerSentEvents as an assembly reference as part of calling GenAPI.
1 parent 254ceb8 commit 38c3c66

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

scripts/Export-Api.ps1

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function Invoke-GenAPI {
107107
Write-Output ""
108108

109109
# System.ClientModel
110-
$systemClientModelPath = Join-Path $nugetPackagesPath "system.clientmodel\1.6.1"
110+
$systemClientModelPath = Join-Path $nugetPackagesPath "system.clientmodel\1.7.0"
111111
$systemClientModelRef = $null
112112
if (Test-Path $systemClientModelPath) {
113113
$systemClientModelRef = Get-ChildItem `
@@ -121,6 +121,21 @@ function Invoke-GenAPI {
121121
Write-Output " $($systemClientModelRef)"
122122
Write-Output ""
123123

124+
# System.Net.ServerSentEvents
125+
$systemNetServerSentEventsPath = Join-Path $nugetPackagesPath "system.net.serversentevents\9.0.9"
126+
$systemNetServerSentEventsRef = $null
127+
if (Test-Path $systemNetServerSentEventsPath) {
128+
$systemNetServerSentEventsRef = Get-ChildItem `
129+
-Path $systemNetServerSentEventsPath `
130+
-Include $(($TargetFramework -eq "netstandard2.0") ? "netstandard2.0" : "net8.0") `
131+
-Recurse |
132+
Select-Object -Last 1
133+
}
134+
135+
Write-Output " * System.Net.ServerSentEvents:"
136+
Write-Output " $($systemNetServerSentEventsRef)"
137+
Write-Output ""
138+
124139
# Microsoft.Extensions.Logging.Abstractions
125140
$microsoftExtensionsLoggingAbstractionsPath = Join-Path $nugetPackagesPath "microsoft.extensions.logging.abstractions\8.0.3"
126141
$microsoftExtensionsLoggingAbstractionsRef = $null
@@ -209,6 +224,7 @@ function Invoke-GenAPI {
209224

210225
if ($netRef) { $genapiArgs += @("--assembly-reference", $netRef) }
211226
if ($systemClientModelRef) { $genapiArgs += @("--assembly-reference", $systemClientModelRef) }
227+
if ($systemNetServerSentEventsRef) { $genapiArgs += @("--assembly-reference", $systemNetServerSentEventsRef) }
212228
if ($microsoftExtensionsLoggingAbstractionsRef) { $genapiArgs += @("--assembly-reference", $microsoftExtensionsLoggingAbstractionsRef) }
213229
if ($microsoftExtensionsDependencyInjectionAbstractionsRef) { $genapiArgs += @("--assembly-reference", $microsoftExtensionsDependencyInjectionAbstractionsRef) }
214230
if ($systemMemoryDataRef) { $genapiArgs += @("--assembly-reference", $systemMemoryDataRef) }

0 commit comments

Comments
 (0)