Skip to content

[release/10.0.1xx-rc1] [StaticWebAssets] Use property for original resource #50436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fb28721
Backflow from https://github.com/dotnet/dotnet / 670981c build 279601
dotnet-maestro[bot] Aug 16, 2025
4d4f67c
Merge release/10.0.1xx-rc1 into darc-release/10.0.1xx-rc1-82a65ebf-8d…
dotnet-maestro[bot] Aug 16, 2025
6f06705
Update dependencies from https://github.com/dotnet/dotnet build 279601
dotnet-maestro[bot] Aug 16, 2025
747dc82
Update dependencies from https://github.com/dotnet/dotnet build 279607
dotnet-maestro[bot] Aug 16, 2025
5cf9480
Update dependencies from https://github.com/dotnet/dotnet build 279620
dotnet-maestro[bot] Aug 17, 2025
7df2da8
Update dependencies from https://github.com/dotnet/dotnet build 279630
dotnet-maestro[bot] Aug 17, 2025
2a6bbb5
revert the backflow code changes
Aug 18, 2025
da23f30
Fix baselines
Aug 18, 2025
13d3fe8
Update CSC arguments
Aug 18, 2025
251e5c7
Add the missing netcore installer to the bundle
marcpopMSFT Aug 18, 2025
a3ab5c9
[release/10.0.1xx-rc1] Add the missing netcore installer to the bundl…
marcpopMSFT Aug 18, 2025
7f56354
[release/10.0.1xx-rc1] Source code updates from dotnet/dotnet (#50308)
SimonZhao888 Aug 19, 2025
76d16a3
Update dependencies from https://github.com/dotnet/dotnet build 279921
dotnet-maestro[bot] Aug 19, 2025
c2ecc0c
[release/10.0.1xx-rc1] Source code updates from dotnet/dotnet (#50361)
joeloff Aug 19, 2025
9f5c51c
Generate pruning data correctly (#50348)
nkolev92 Aug 19, 2025
e1ce879
Update to the September implicit version
marcpopMSFT Aug 18, 2025
e4c028b
Override stage 2 bundled versions like we used to as this is the only…
marcpopMSFT Aug 18, 2025
de28e25
switch to lowercase sdk
marcpopMSFT Aug 19, 2025
129aec5
Fix our overlay to update the redist-installer path as that gets copi…
marcpopMSFT Aug 19, 2025
e34242c
Spit out a few binlogs to get some more information about the particu…
marcpopMSFT Aug 20, 2025
00f8f8a
Add a few new items to the known framework overload that weren't cove…
marcpopMSFT Aug 20, 2025
ab60969
Add output to the override so we can confirm everything that's being …
marcpopMSFT Aug 20, 2025
ca8e965
Update all of the current versions, not just the first one.
marcpopMSFT Aug 20, 2025
1188193
Update the RID for the sdk to be the target rid for stage2
marcpopMSFT Aug 21, 2025
81d1aee
Cleanup from passing PR to remove the diagnostics info
marcpopMSFT Aug 21, 2025
11940f6
Update to the September implicit version (#50344)
marcpopMSFT Aug 21, 2025
eecddb9
Fix
javiercn Aug 21, 2025
f5e0a85
Cleanup
javiercn Aug 21, 2025
48315c4
Update baselines
javiercn Aug 21, 2025
f4cd06f
Fix test by overriding the default
javiercn Aug 22, 2025
f8aefab
Rename property
javiercn Aug 22, 2025
808fd55
Fix MSBuild expression
javiercn Aug 22, 2025
d80bf19
Update src/StaticWebAssetsSdk/Targets/Microsoft.NET.Sdk.StaticWebAsse…
javiercn Aug 22, 2025
116f6e2
Update test/TestAssets/TestProjects/WatchRazorWithDeps/RazorApp/Razor…
javiercn Aug 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
267 changes: 131 additions & 136 deletions eng/Version.Details.props

Large diffs are not rendered by default.

524 changes: 262 additions & 262 deletions eng/Version.Details.xml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
<VersionFeature60>36</VersionFeature60>
<VersionFeature70>20</VersionFeature70>
<!-- This version should be N-1 (ie the currently released version) in the preview branch but N-2 in main so that workloads stay behind the unreleased version -->
<VersionFeature80>17</VersionFeature80>
<VersionFeature90>6</VersionFeature90>
<VersionFeature80>20</VersionFeature80>
<VersionFeature90>9</VersionFeature90>
<!-- Should be kept in sync with VersionFeature70. It should match the version of Microsoft.NET.ILLink.Tasks
referenced by the same 7.0 SDK that references the 7.0.VersionFeature70 runtime pack. -->
<_NET70ILLinkPackVersion>7.0.100-1.23211.1</_NET70ILLinkPackVersion>
Expand Down Expand Up @@ -128,7 +128,7 @@
</PropertyGroup>
<PropertyGroup Label="Manually updated">
<!-- Dependencies from https://github.com/microsoft/MSBuildLocator -->
<MicrosoftBuildLocatorPackageVersion>1.6.10</MicrosoftBuildLocatorPackageVersion>
<MicrosoftBuildLocatorPackageVersion>1.8.1</MicrosoftBuildLocatorPackageVersion>
<MicrosoftCodeAnalysisCSharpAnalyzerPinnedVersionPackageVersion>4.0.1</MicrosoftCodeAnalysisCSharpAnalyzerPinnedVersionPackageVersion>
</PropertyGroup>
<!-- Get .NET Framework reference assemblies from NuGet packages -->
Expand Down
6 changes: 3 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"errorMessage": "The .NET SDK is not installed or is not configured correctly. Please run ./build to install the correct SDK version locally."
},
"tools": {
"dotnet": "10.0.100-preview.7.25372.107",
"dotnet": "10.0.100-rc.1.25411.109",
"runtimes": {
"dotnet": [
"$(MicrosoftNETCorePlatformsPackageVersion)"
Expand All @@ -21,8 +21,8 @@
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25411.109",
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25411.109",
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25418.115",
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25418.115",
"Microsoft.Build.NoTargets": "3.7.0",
"Microsoft.Build.Traversal": "3.4.0",
"Microsoft.WixToolset.Sdk": "5.0.2-dotnet.2737382"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private IEnumerable<string> GetCscArguments(
"/warnaserror-",
"/utf8output",
"/deterministic+",
"/langversion:13.0",
"/langversion:14.0",
"/features:FileBasedProgram",
$"/analyzerconfig:{SdkPath}/Sdks/Microsoft.NET.Sdk/codestyle/cs/build/config/analysislevelstyle_default.globalconfig",
$"/analyzerconfig:{objDir}/{fileNameWithoutExtension}.GeneratedMSBuildEditorConfig.editorconfig",
Expand Down
2 changes: 1 addition & 1 deletion src/Layout/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
because it is large (100MB+). -->
<_IsCommunityPlatform Condition="'$(OSName)' != 'win' and '$(OSName)' != 'osx'
and !('$(OSName)' == 'linux' and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'x86' or '$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'arm64'))">true</_IsCommunityPlatform>
<BundleCrossgen2 Condition="'$(BundleCrossgen2)' == '' and '$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetBuildUseMonoRuntime)' != 'true' and '$( _IsCommunityPlatform )' == 'true'">true</BundleCrossgen2>
<BundleCrossgen2 Condition="'$(BundleCrossgen2)' == '' and '$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetBuildUseMonoRuntime)' != 'true' and '$(_IsCommunityPlatform)' == 'true'">true</BundleCrossgen2>

<!-- Use the portable "linux-x64" Rid when downloading Linux shared framework compressed file. -->
<UsePortableLinuxSharedFramework Condition="'$(UsePortableLinuxSharedFramework)' == '' and '$(IsLinux)' == 'true' and !$(TargetRid.StartsWith('linux-musl'))">true</UsePortableLinuxSharedFramework>
Expand Down
3 changes: 2 additions & 1 deletion src/Layout/redist/targets/GenerateMSIs.targets
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@
<_DotNetMsiPackages Include="$(DownloadsFolder)$(DownloadedHostFxrInstallerFileName);
$(DownloadsFolder)$(DownloadedSharedHostInstallerFileName);
$(DownloadsFolder)$(DownloadedSharedFrameworkInstallerFileName);
$(DownloadsFolder)$(DownloadedNetCoreAppHostPackInstallerFileName)"/>
$(DownloadsFolder)$(DownloadedNetCoreAppHostPackInstallerFileName);
$(DownloadsFolder)$(DownloadedNetCoreAppTargetingPackInstallerFileName)"/>

<!-- ASP.NET Core Runtime -->
<_DotNetMsiPackages Include="$(DownloadsFolder)$(DownloadedAspNetCoreSharedFxInstallerFileName);
Expand Down
13 changes: 13 additions & 0 deletions src/Layout/redist/targets/OverlaySdkOnLKG.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
<_DotNetHiveRoot Condition="!HasTrailingSlash('$(_DotNetHiveRoot)')">$(_DotNetHiveRoot)/</_DotNetHiveRoot>
</PropertyGroup>

<!-- Get stage 0 SDK version without having to duplicate the LKG SDK property between the global.json
and a property. -->
<Exec Command="$(DotnetTool) --version" ConsoleToMsbuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="Stage0SdkVersion"/>
</Exec>

<!-- Copy artifacts from the stage0 SDK folder.
Ignore the sdk, templates and host files for which only live built artifacts should be used. -->
<ItemGroup>
Expand All @@ -24,6 +30,13 @@
<InstallerOutputFile Include="@(OverlaySDKFile)" Exclude="@(InstallerOutputFile)" />
</ItemGroup>

<OverrideAndCreateBundledNETCoreAppPackageVersion
Stage0MicrosoftNETCoreAppRefPackageVersionPath="$(_DotNetHiveRoot)/sdk/$(Stage0SdkVersion)/Microsoft.NETCoreSdk.BundledVersions.props"
MicrosoftNETCoreAppRefPackageVersion="$(MicrosoftNETCoreAppRefPackageVersion)"
NewSDKVersion="$(Version)"
TargetRid="$(TargetRid)"
OutputPath="$(RedistInstallerLayoutPath)/sdk/$(Version)/Microsoft.NETCoreSdk.BundledVersions.props"/>

<!-- Copy artifacts to the testhost folder. -->
<Copy DestinationFiles="@(InstallerOutputFile)"
SourceFiles="@(InstallerOutputFile->Metadata('Source'))"
Expand Down
8 changes: 4 additions & 4 deletions src/Microsoft.CodeAnalysis.NetAnalyzers/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Microsoft.CodeAnalysis.NetAnalyzers
This folder contains the source code for the .NET analyzers that are part of the Microsoft.CodeAnalysis.NetAnalyzers package.
This code formerly lived in the [dotnet/roslyn-analyzers](https://github.com/dotnet/roslyn-analyzers) repository.
# Microsoft.CodeAnalysis.NetAnalyzers

This folder contains the source code for the .NET analyzers that are part of the Microsoft.CodeAnalysis.NetAnalyzers package.
This code formerly lived in the [dotnet/roslyn-analyzers](https://github.com/dotnet/roslyn-analyzers) repository.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ Copyright (c) .NET Foundation. All rights reserved.
<BrotliCompressionLevel Condition="'$(_BlazorBrotliCompressionLevel)' != ''">$(_BlazorBrotliCompressionLevel)</BrotliCompressionLevel>

<!-- Attach weak ETag to compressed assets -->
<AttachWeakETagToCompressedAssetsDuringDevelopment Condition="'$(AttachWeakETagToCompressedAssetsDuringDevelopment)' == '' and '$(Configuration)' == 'Debug'">true</AttachWeakETagToCompressedAssetsDuringDevelopment>
<LinkAlternativeRepresentationsToOriginalResource Condition="'$(LinkAlternativeRepresentationsToOriginalResource)' == '' and '$(_TargetingNET100OrLater)' == 'true'">EndpointProperty</LinkAlternativeRepresentationsToOriginalResource>
<LinkAlternativeRepresentationsToOriginalResource Condition="'$(LinkAlternativeRepresentationsToOriginalResource)' == ''">ResponseHeader</LinkAlternativeRepresentationsToOriginalResource>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -253,7 +254,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<ApplyCompressionNegotiation
CandidateEndpoints="@(StaticWebAssetEndpoint)"
CandidateAssets="@(_CompressionCurrentProjectBuildAssets)"
AttachWeakETagToCompressedAssets="$(AttachWeakETagToCompressedAssetsDuringDevelopment)"
AttachWeakETagToCompressedAssets="$(LinkAlternativeRepresentationsToOriginalResource)"
>
<Output TaskParameter="UpdatedEndpoints" ItemName="_UpdatedCompressionBuildEndpoints" />
</ApplyCompressionNegotiation>
Expand Down Expand Up @@ -377,7 +378,8 @@ Copyright (c) .NET Foundation. All rights reserved.

<ApplyCompressionNegotiation
CandidateEndpoints="@(StaticWebAssetEndpoint)"
CandidateAssets="@(_CompressionCurrentProjectPublishAssets)">
CandidateAssets="@(_CompressionCurrentProjectPublishAssets)"
AttachWeakETagToCompressedAssets="$(LinkAlternativeRepresentationsToOriginalResource)">
<Output TaskParameter="UpdatedEndpoints" ItemName="_UpdatedCompressionPublishEndpoints" />
</ApplyCompressionNegotiation>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ Copyright (c) .NET Foundation. All rights reserved.

<!-- Resolve the TFM-specific attributes conditionally. -->
<Choose>
<When Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '10.0')) ">
<PropertyGroup>
<_TargetingNETCoreApp30OrLater>true</_TargetingNETCoreApp30OrLater>
<_TargetingNET50OrLater>true</_TargetingNET50OrLater>
<_TargetingNET60OrLater>true</_TargetingNET60OrLater>
<_TargetingNET70OrLater>true</_TargetingNET70OrLater>
<_TargetingNET80OrLater>true</_TargetingNET80OrLater>
<_TargetingNET90OrLater>true</_TargetingNET90OrLater>
<_TargetingNET100OrLater>true</_TargetingNET100OrLater>
<_RazorLangVersion Condition="'$(RazorLangVersion)' == '' ">10.0</_RazorLangVersion>
</PropertyGroup>
</When>
<When Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '9.0')) ">
<PropertyGroup>
<_TargetingNETCoreApp30OrLater>true</_TargetingNETCoreApp30OrLater>
Expand Down
27 changes: 24 additions & 3 deletions src/StaticWebAssetsSdk/Tasks/ApplyCompressionNegotiation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ApplyCompressionNegotiation : Task
[Required]
public ITaskItem[] CandidateAssets { get; set; }

public bool AttachWeakETagToCompressedAssets { get; set; }
public string AttachWeakETagToCompressedAssets { get; set; }

[Output]
public ITaskItem[] UpdatedEndpoints { get; set; }
Expand Down Expand Up @@ -248,6 +248,27 @@ private StaticWebAssetEndpoint CreateUpdatedEndpoint(
Quality = quality
};
Log.LogMessage(MessageImportance.Low, " Created Content-Encoding selector for compressed asset '{0}' with size '{1}' is '{2}'", encodingSelector.Value, encodingSelector.Quality, relatedEndpointCandidate.Route);

// Handle EndpointProperty case for ETag
var endpointProperties = relatedEndpointCandidate.EndpointProperties.ToList();
if (string.Equals(AttachWeakETagToCompressedAssets, "EndpointProperty", StringComparison.Ordinal))
{
// Find ETag header in the related endpoint candidate
foreach (var header in relatedEndpointCandidate.ResponseHeaders)
{
if (string.Equals(header.Name, "ETag", StringComparison.Ordinal))
{
Log.LogMessage(MessageImportance.Low, " Adding original-resource endpoint property for related endpoint '{0}'", relatedEndpointCandidate.Route);
endpointProperties.Add(new StaticWebAssetEndpointProperty
{
Name = "original-resource",
Value = header.Value
});
break;
}
}
}

var endpointCopy = new StaticWebAssetEndpoint
{
AssetFile = compressedAsset.Identity,
Expand All @@ -256,7 +277,7 @@ private StaticWebAssetEndpoint CreateUpdatedEndpoint(
..relatedEndpointCandidate.Selectors,
encodingSelector
],
EndpointProperties = relatedEndpointCandidate.EndpointProperties
EndpointProperties = [.. endpointProperties]
};
var headers = new List<StaticWebAssetEndpointResponseHeader>(7);
ApplyCompressedEndpointHeaders(headers, compressedEndpoint, relatedEndpointCandidate.Route);
Expand Down Expand Up @@ -373,7 +394,7 @@ private void ApplyRelatedEndpointCandidateHeaders(List<StaticWebAssetEndpointRes
Log.LogMessage(MessageImportance.Low, " Adding header '{0}' to related endpoint '{1}'", header.Name, relatedEndpointCandidate.Route);
headers.Add(header);
}
else if (AttachWeakETagToCompressedAssets && string.Equals(header.Name, "ETag", StringComparison.Ordinal))
else if (string.Equals(AttachWeakETagToCompressedAssets, "ResponseHeader", StringComparison.Ordinal) && string.Equals(header.Name, "ETag", StringComparison.Ordinal))
{
// A resource can have multiple ETags. Since the uncompressed resource has an ETag,
// and we are serving the compressed resource from the same URL, we need to update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ Copyright (c) .NET Foundation. All rights reserved.
</Target>

<!-- TODO: https://github.com/dotnet/sdk/issues/49917 Remove the framework based condition when the data for netcoreapp2.1 and below is fixed-->
<!-- Package pruning is expected to be enable for all TFMs for multi-targeted projects, so still generate the pruning data when RestoreEnablePackagePruning is '' which implies a multi-targeted project. -->
<Target Name="AddPrunePackageReferences" BeforeTargets="CollectPrunePackageReferences"
DependsOnTargets="ProcessFrameworkReferences"
Condition="'$(RestoreEnablePackagePruning)' == 'true'
Condition="('$(RestoreEnablePackagePruning)' == 'true' OR '$(RestoreEnablePackagePruning)' == '')
AND (('$(TargetFrameworkIdentifier)' == '.NETCoreApp'
AND '$(TargetFrameworkVersion)' != ''
AND $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '3.0')))
Expand Down
Loading