Skip to content

Commit 8c0d467

Browse files
eerhardtradical
authored andcommitted
Fix OpenApi dependency version to align with the rest (#12453)
We are currently not updating the template versions for OpenApi when we update the rest of the dependency versions. Making those versions look like the rest should help with this.
1 parent eb47e07 commit 8c0d467

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@
248248
</ItemGroup>
249249
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
250250
<!-- ASP.NET Core -->
251-
<PackageVersion Update="Microsoft.AspNetCore.OpenApi" Version="$(MicrosoftAspNetCorePackageVersionForNet10)" />
251+
<PackageVersion Update="Microsoft.AspNetCore.OpenApi" Version="$(MicrosoftAspNetCoreOpenApiPreviewVersion)" />
252252
<!-- Runtime -->
253253
<PackageVersion Update="Microsoft.Extensions.Hosting.Abstractions" Version="$(MicrosoftExtensionsHostingAbstractionsPreviewVersion)" />
254254
<PackageVersion Update="Microsoft.Extensions.Hosting" Version="$(MicrosoftExtensionsHostingPreviewVersion)" />

eng/Versions.props

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,15 @@
4949
<MicrosoftExtensionsTimeProviderTestingVersion>9.10.0</MicrosoftExtensionsTimeProviderTestingVersion>
5050
<MicrosoftExtensionsServiceDiscoveryVersion>9.5.0</MicrosoftExtensionsServiceDiscoveryVersion>
5151
<MicrosoftExtensionsServiceDiscoveryYarpVersion>9.5.0</MicrosoftExtensionsServiceDiscoveryYarpVersion>
52-
<!-- for templates -->
53-
<MicrosoftAspNetCorePackageVersionForNet9>9.0.9</MicrosoftAspNetCorePackageVersionForNet9>
54-
<MicrosoftAspNetCorePackageVersionForNet10>10.0.0-rc.1.25451.107</MicrosoftAspNetCorePackageVersionForNet10>
5552
<!-- Fuzzing tests -->
5653
<SharpFuzzPackageVersion>2.1.1</SharpFuzzPackageVersion>
5754
<!-- Aspire.Cli uses a preview version of StreamJsonRpc which is needed for native AOT support. -->
5855
<StreamJsonRpcPackageVersionForCli>2.23.32-alpha</StreamJsonRpcPackageVersionForCli>
5956
</PropertyGroup>
6057
<!-- .NET 10.0 Package Versions -->
6158
<PropertyGroup Label="Preview">
59+
<!-- ASP.NET Core -->
60+
<MicrosoftAspNetCoreOpenApiPreviewVersion>10.0.0-rc.2.25502.107</MicrosoftAspNetCoreOpenApiPreviewVersion>
6261
<!-- Runtime -->
6362
<MicrosoftExtensionsHostingAbstractionsPreviewVersion>10.0.0-rc.2.25502.107</MicrosoftExtensionsHostingAbstractionsPreviewVersion>
6463
<MicrosoftExtensionsHostingPreviewVersion>10.0.0-rc.2.25502.107</MicrosoftExtensionsHostingPreviewVersion>

src/Aspire.ProjectTemplates/Aspire.ProjectTemplates.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
<WriteLinesToFile File="%(TemplateProjectFiles.DestinationFile)"
7171
Lines="$([System.IO.File]::ReadAllText('%(TemplateProjectFiles.FullPath)')
7272
.Replace('!!REPLACE_WITH_LATEST_VERSION!!', '$(PackageVersion)')
73-
.Replace('!!REPLACE_WITH_ASPNETCORE_9_VERSION!!', '$(MicrosoftAspNetCorePackageVersionForNet9)')
74-
.Replace('!!REPLACE_WITH_ASPNETCORE_10_VERSION!!', '$(MicrosoftAspNetCorePackageVersionForNet10)')
73+
.Replace('!!REPLACE_WITH_ASPNETCORE_OPENAPI_9_VERSION!!', '$(MicrosoftAspNetCoreOpenApiVersion)')
74+
.Replace('!!REPLACE_WITH_ASPNETCORE_OPENAPI_10_VERSION!!', '$(MicrosoftAspNetCoreOpenApiPreviewVersion)')
7575
.Replace('!!REPLACE_WITH_DOTNET_EXTENSIONS_VERSION!!', '$(MicrosoftExtensionsHttpResilienceVersion)')
7676
.Replace('!!REPLACE_WITH_SERVICE_DISCOVERY_VERSION!!', '$(MicrosoftExtensionsServiceDiscoveryVersion)')
7777
.Replace('!!REPLACE_WITH_OTEL_NET8_VERSION!!', '$(OpenTelemetryNet8Version)')

src/Aspire.ProjectTemplates/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ For each template:
2626
5. If supported TFMs changed between old previous version and new previous version, or old current version and new current version, add or update `AspireNetXVersion` options appropriately. Note that the `AspireVersion` option maps to the `net8.0` TFM.
2727
6. In all *.csproj* files in the content folder named for the new previous version, e.g. *./9.4/**/*.csproj*:
2828
1. Update all versions for Aspire-produced packages (and SDKs) referenced to the new previous package version (`major.minor.patch` for latest patch), replacing the replacement token value with a static version value, e.g. `!!REPLACE_WITH_LATEST_VERSION!!` -> `9.4.2`
29-
2. Update all versions for non-Aspire packages to the version referenced by current released version of the template, replacing the replacement token value with the relevant static version value, e.g. `!!REPLACE_WITH_ASPNETCORE_10_VERSION!!` -> `10.0.0-preview.7.25380.108`. Some non-Aspire packages referenced don't use a replacement token and instead just use a static value. In these cases simply leave the value as is.
29+
2. Update all versions for non-Aspire packages to the version referenced by current released version of the template, replacing the replacement token value with the relevant static version value, e.g. `!!REPLACE_WITH_ASPNETCORE_OPENAPI_10_VERSION!!` -> `10.0.0-preview.7.25380.108`. Some non-Aspire packages referenced don't use a replacement token and instead just use a static value. In these cases simply leave the value as is.
3030

3131
**Note:** There's a few ways to determine the static version value:
3232
- Look at the contents of the latest released version of the templates package at https://nuget.info/packages/Aspire.ProjectTemplates and find the version from the relvant *.csproj* file in the template package content
33-
- Checkout the relevant `release/X.X` branch for the latest public release, e.g. `release/9.4`, and in the *./src/Aspire.ProjectTemplates/* directory, run the `dotnet` CLI command to extract the appropriate version from the build system, e.g. `dotnet msbuild -getProperty:MicrosoftAspNetCorePackageVersionForNet9`. The property name to pass for a given replacement token can be determined by looking in the *./src/Aspire.ProjectTemplates/Aspire.ProjectTemplates.csproj* file, at the `<WriteLinesToFile ...>` task, which should look something like the following:
33+
- Checkout the relevant `release/X.X` branch for the latest public release, e.g. `release/9.4`, and in the *./src/Aspire.ProjectTemplates/* directory, run the `dotnet` CLI command to extract the appropriate version from the build system, e.g. `dotnet msbuild -getProperty:MicrosoftAspNetCoreOpenApiVersion`. The property name to pass for a given replacement token can be determined by looking in the *./src/Aspire.ProjectTemplates/Aspire.ProjectTemplates.csproj* file, at the `<WriteLinesToFile ...>` task, which should look something like the following:
3434
```xml
3535
<WriteLinesToFile File="%(TemplateProjectFiles.DestinationFile)"
3636
Lines="$([System.IO.File]::ReadAllText('%(TemplateProjectFiles.FullPath)')
3737
.Replace('!!REPLACE_WITH_LATEST_VERSION!!', '$(PackageVersion)')
38-
.Replace('!!REPLACE_WITH_ASPNETCORE_9_VERSION!!', '$(MicrosoftAspNetCorePackageVersionForNet9)')
39-
.Replace('!!REPLACE_WITH_ASPNETCORE_10_VERSION!!', '$(MicrosoftAspNetCorePackageVersionForNet10)')
38+
.Replace('!!REPLACE_WITH_ASPNETCORE_OPENAPI_9_VERSION!!', '$(MicrosoftAspNetCoreOpenApiVersion)')
39+
.Replace('!!REPLACE_WITH_ASPNETCORE_OPENAPI_10_VERSION!!', '$(MicrosoftAspNetCoreOpenApiPreviewVersion)')
4040
.Replace('!!REPLACE_WITH_DOTNET_EXTENSIONS_VERSION!!', '$(MicrosoftExtensionsHttpResilienceVersion)')
4141
.Replace('!!REPLACE_WITH_OTEL_NET8_VERSION!!', '$(OpenTelemetryNet8Version)')
4242
.Replace('!!REPLACE_WITH_OTEL_EXPORTER_VERSION!!', '$(OpenTelemetryExporterOpenTelemetryProtocolVersion)')

src/Aspire.ProjectTemplates/templates/aspire-starter/13.0/Aspire-StarterApplication.1.ApiService/Aspire-StarterApplication.1.ApiService.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="!!REPLACE_WITH_ASPNETCORE_9_VERSION!!" Condition=" '$(Framework)' == 'net9.0' " />
15-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="!!REPLACE_WITH_ASPNETCORE_10_VERSION!!" Condition=" '$(Framework)' == 'net10.0' " />
14+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="!!REPLACE_WITH_ASPNETCORE_OPENAPI_9_VERSION!!" Condition=" '$(Framework)' == 'net9.0' " />
15+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="!!REPLACE_WITH_ASPNETCORE_OPENAPI_10_VERSION!!" Condition=" '$(Framework)' == 'net10.0' " />
1616
</ItemGroup>
1717

1818
</Project>

0 commit comments

Comments
 (0)