Upgraded to .NET 10 (#1147)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-01 20:32:16 +01:00
1 parent faae2951f7
commit fc7399e81b
327 files changed
+3059 -3049

No files matched your search

@@ -5,7 +5,7 @@
<PropertyGroup>
<Authors>Thorsten Sommer</Authors>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>CS8600;CS8602;CS8603;CS9057</WarningsAsErrors> <!-- CS9057: fail instead of silently skipping an analyzer which needs a newer compiler than the SDK's -->
<ImplicitUsings>enable</ImplicitUsings>
@@ -45,6 +45,13 @@
-->
<NoWarn>IL2026, CS8974</NoWarn>
<LangVersion>latest</LangVersion>
<!--
Since .NET 10, the scripts of Blazor come from a package, which the release embeds: see the
EmbedBlazorScript target. The SDK adds that package by itself when it spots Razor files; we
ask for it here, so that the release does not hinge on that guess.
-->
<RequiresAspNetWebAssets>true</RequiresAspNetWebAssets>
</PropertyGroup>
<Import Project="..\Trimming.props" />
@@ -71,22 +78,20 @@
<PackageReference Include="DocumentFormat.OpenXml" Version="3.5.1" />
<PackageReference Include="HtmlAgilityPack" Version="1.12.4" />
<PackageReference Include="MailKit" Version="4.18.2" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="9.0.22" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.22" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="9.0.22" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="10.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.14" />
<!--
Its assembly ships with ASP.NET Core, but the package also brings the build logic which writes the
manifest of the embedded files. Without that manifest, the release serves no static files at all, and
WebRootFiles finds neither the changelogs nor the ERI specifications in any build.
-->
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="10.0.14" />
<PackageReference Include="MudBlazor" Version="9.12.0" />
<PackageReference Include="MudBlazor.Markdown" Version="9.0.0" />
<PackageReference Include="ReverseMarkdown" Version="5.0.0" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="3.0.5" />
<PackageReference Include="LuaCSharp" Version="0.5.8" />
<!--
Not used by AI Studio directly: MailKit pulls it in through MimeKit, which asks for 10.0.0. That
version is affected by CVE-2026-70162 and CVE-2026-84008 (GHSA-2fmv-rv2c-59x7, GHSA-846f-f764-76mx),
fixed in 10.0.13. The package wins over the older copy within the .NET runtime, so upgrading .NET
alone does not help. Remove this reference once MimeKit itself asks for 10.0.13 or newer.
-->
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="10.0.13" />
</ItemGroup>
<ItemGroup>
@@ -117,13 +122,26 @@
<ReadLinesFromFile File="../../metadata.txt">
<Output TaskParameter="Lines" PropertyName="Metadata" />
</ReadLinesFromFile>
<!--
metadata.txt names the .NET SDK which the pipeline pins, but a local build may use another
one. Hence, we take the SDK which builds right now. Its .version file starts with the commit
it was built from. The .NET runtime is not recorded at all: the app asks for it while it runs.
-->
<PropertyGroup>
<DotnetSdkVersionFile>$(NetCoreRoot)sdk/$(NETCoreSdkVersion)/.version</DotnetSdkVersionFile>
</PropertyGroup>
<ReadLinesFromFile File="$(DotnetSdkVersionFile)" Condition="Exists('$(DotnetSdkVersionFile)')">
<Output TaskParameter="Lines" PropertyName="DotnetSdkVersionLines" />
</ReadLinesFromFile>
<PropertyGroup>
<MetaVersion>$([System.String]::Copy( $(Metadata) ).Split( ';' )[ 0 ])</MetaVersion>
<MetaBuildTime>$([System.String]::Copy( $(Metadata) ).Split( ';' )[ 1 ])</MetaBuildTime>
<MetaBuild>$([System.String]::Copy( $(Metadata) ).Split( ';' )[ 2 ])</MetaBuild>
<MetaDotnetSdkVersion>$([System.String]::Copy( $(Metadata) ).Split( ';' )[ 3 ])</MetaDotnetSdkVersion>
<MetaDotnetVersion>$([System.String]::Copy( $(Metadata) ).Split( ';' )[ 4 ])</MetaDotnetVersion>
<MetaDotnetSdkVersion Condition="'$(DotnetSdkVersionLines)' != ''">$(NETCoreSdkVersion) (commit $([System.String]::Copy( $(DotnetSdkVersionLines) ).Split( ';' )[ 0 ].Substring( 0, 10 )))</MetaDotnetSdkVersion>
<MetaRustVersion>$([System.String]::Copy( $(Metadata) ).Split( ';' )[ 5 ])</MetaRustVersion>
<MetaMudBlazorVersion>$([System.String]::Copy( $(Metadata) ).Split( ';' )[ 6 ])</MetaMudBlazorVersion>
<MetaTauriVersion>$([System.String]::Copy( $(Metadata) ).Split( ';' )[ 7 ])</MetaTauriVersion>
@@ -152,11 +170,10 @@
<_Parameter3>$(MetaBuild)</_Parameter3>
<_Parameter3_TypeName>System.UInt32</_Parameter3_TypeName>
<_Parameter4>$(MetaDotnetSdkVersion)</_Parameter4>
<_Parameter5>$(MetaDotnetVersion)</_Parameter5>
<_Parameter6>$(MetaRustVersion)</_Parameter6>
<_Parameter7>$(MetaMudBlazorVersion)</_Parameter7>
<_Parameter8>$(MetaTauriVersion)</_Parameter8>
<_Parameter9>$(MetaAppCommitHash)</_Parameter9>
<_Parameter5>$(MetaRustVersion)</_Parameter5>
<_Parameter6>$(MetaMudBlazorVersion)</_Parameter6>
<_Parameter7>$(MetaTauriVersion)</_Parameter7>
<_Parameter8>$(MetaAppCommitHash)</_Parameter8>
</AssemblyAttribute>
<AssemblyAttribute Include="AIStudio.Tools.Metadata.MetaDataArchitecture">
<_Parameter1>$(MetaArchitecture)</_Parameter1>
@@ -171,6 +188,18 @@
</Target>
<!--
Since .NET 10, NuGet prunes a package whose assemblies ship with the shared framework, and with it the
package's build logic. Microsoft.Extensions.FileProviders.Embedded must not go this way, see its reference
above. .NET 10.0.0 already leaves it out of the pruning (dotnet/aspnetcore#63719); this target keeps it
even if a later version of .NET prunes it again. It is the workaround Microsoft gives in that issue.
-->
<Target Name="_PreserveFileProvidersEmbeddedPackageReference" AfterTargets="AddPrunePackageReferences">
<ItemGroup>
<PrunePackageReference Remove="Microsoft.Extensions.FileProviders.Embedded" />
</ItemGroup>
</Target>
<!--
Scoped CSS (`.razor.css`) is bundled into `$(AssemblyName).styles.css`, which App.razor links.
That bundle is generated at build time, so it never lives in the source tree's wwwroot. The
@@ -197,4 +226,28 @@
</ItemGroup>
</Target>
<!--
`_framework/blazor.web.js` makes the UI interactive, and App.razor loads it. Up to .NET 9, the shared
framework served it. Since .NET 10, it is a static web asset of the package Microsoft.AspNetCore.App.Internal.Assets,
which names its folder in BlazorFrameworkStaticWebAssetRoot. Like the scoped CSS bundle above, the release
would therefore lack it: the window would show the app, but nothing in it would react. Hence: embed it
before the manifest is written.
-->
<Target Name="EmbedBlazorScript" BeforeTargets="_CalculateEmbeddedFilesManifestInputs">
<PropertyGroup>
<BlazorScriptToEmbed>$(BlazorFrameworkStaticWebAssetRoot)\blazor.web.js</BlazorScriptToEmbed>
</PropertyGroup>
<!--
Fail loudly instead of shipping a release without the script: a missing file here means the
package moved it, or the SDK no longer adds the package.
-->
<Error Condition="'$(BlazorFrameworkStaticWebAssetRoot)' == '' Or !Exists('$(BlazorScriptToEmbed)')"
Text="The script of Blazor was not found at '$(BlazorScriptToEmbed)'. Without it, the release starts with a window which does not react at all. Check where .NET keeps blazor.web.js and adjust the EmbedBlazorScript target." />
<ItemGroup>
<EmbeddedResource Include="$(BlazorScriptToEmbed)" Link="wwwroot\_framework\blazor.web.js" />
</ItemGroup>
</Target>
</Project>