-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
In Microsoft.Crank and the ASP.NET Benchmarks, we specify a specific .NET runtime version to use using the following code:
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
project.Root.Add(
new XElement("ItemGroup",
new XElement("FrameworkReference",
new XAttribute("Update", "Microsoft.AspNetCore.App"),
new XAttribute("RuntimeFrameworkVersion", "$(MicrosoftAspNetCoreAppPackageVersion)")
),
new XElement("FrameworkReference",
new XAttribute("Update", "Microsoft.NETCore.App"),
new XAttribute("RuntimeFrameworkVersion", "$(MicrosoftNETCoreAppPackageVersion)")
)
)
);
}
else
{
project.Root.Add(
new XElement("ItemGroup",
new XElement("FrameworkReference",
new XAttribute("Update", "Microsoft.AspNetCore.App"),
new XAttribute("RuntimeFrameworkVersion", "$(MicrosoftAspNetCoreAppPackageVersion)")
),
new XElement("FrameworkReference",
new XAttribute("Update", "Microsoft.NETCore.App"),
new XAttribute("RuntimeFrameworkVersion", "$(MicrosoftNETCoreAppPackageVersion)")
),
new XElement("FrameworkReference",
new XAttribute("Update", "Microsoft.WindowsDesktop.App"),
new XAttribute("RuntimeFrameworkVersion", "$(MicrosoftWindowsDesktopAppPackageVersion)")
)
)
);
}For "normal" CoreCLR apps, this is all that is needed to specify which version of the runtime to use.
However, this doesn't work with -p:PublishAot=true. If I add:
<ItemGroup>
<FrameworkReference Update="Microsoft.NETCore.App"
RuntimeFrameworkVersion="8.0.0-alpha.1.23080.1" />
</ItemGroup>To my .csproj, and then inspect the ilc.rsp file that says which version of the runtime is being used, I see:
-r:C:\Users\eerhardt\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\8.0.0-alpha.1.23074.4\sdk\System.Private.CoreLib.dll
The PublishAot tooling should respect updating the FrameworkReference, just like other .NET apps do.
Because of this, we don't pick up the latest runtime changes in the ASP.NET AOT benchmarks until the runtime has flown all the way to dotnet/installer. We want to support the same workflow as the rest of the benchmarks, and pick up the latest runtime version as the official build is built.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status