Skip to content

Conversation

@dotnet-maestro
Copy link
Contributor

@dotnet-maestro dotnet-maestro bot commented Aug 20, 2025

Note

This is a codeflow update. It may contain both source code changes from the VMR as well as dependency updates. Learn more here.

This pull request brings the following source code changes

From https://github.com/dotnet/dotnet

Updated Dependencies

Associated changes in source repos

Updated Dependencies:
Microsoft.CodeAnalysis, Microsoft.CodeAnalysis.Analyzers, Microsoft.CodeAnalysis.CSharp, Microsoft.Net.Compilers.Toolset (Version 5.0.0-2.25418.105 -> 5.0.0-2.25419.104)
Microsoft.CodeAnalysis.NetAnalyzers (Version 10.0.0-preview.25418.105 -> 10.0.100-rc.1.25419.104)
Microsoft.DotNet.ApiCompat.Task, Microsoft.NET.Workload.Emscripten.Current.Manifest-10.0.100.Transport (Version 10.0.100-rc.1.25418.105 -> 10.0.100-rc.1.25419.104)
Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.Build.Tasks.Archives, Microsoft.DotNet.Build.Tasks.Feed, Microsoft.DotNet.Build.Tasks.Installers, Microsoft.DotNet.Build.Tasks.Packaging, Microsoft.DotNet.Build.Tasks.TargetFramework, Microsoft.DotNet.Build.Tasks.Templating, Microsoft.DotNet.Build.Tasks.Workloads, Microsoft.DotNet.CodeAnalysis, Microsoft.DotNet.GenAPI, Microsoft.DotNet.GenFacades, Microsoft.DotNet.Helix.Sdk, Microsoft.DotNet.PackageTesting, Microsoft.DotNet.RemoteExecutor, Microsoft.DotNet.SharedFramework.Sdk, Microsoft.DotNet.XliffTasks, Microsoft.DotNet.XUnitExtensions (Version 10.0.0-beta.25418.105 -> 10.0.0-beta.25419.104)
Microsoft.DotNet.Cecil (Version 0.11.5-alpha.25418.105 -> 0.11.5-alpha.25419.104)
Microsoft.DotNet.XUnitAssert, Microsoft.DotNet.XUnitConsoleRunner (Version 2.9.3-beta.25418.105 -> 2.9.3-beta.25419.104)
Microsoft.NET.Sdk.IL, Microsoft.NETCore.App.Ref, Microsoft.NETCore.ILAsm, runtime.native.System.IO.Ports, System.Reflection.Metadata, System.Reflection.MetadataLoadContext, System.Text.Json (Version 10.0.0-rc.1.25418.105 -> 10.0.0-rc.1.25419.104)
NuGet.Frameworks, NuGet.Packaging, NuGet.ProjectModel, NuGet.Versioning (Version 7.0.0-preview.1.41905 -> 7.0.0-preview.1.42004)
System.CommandLine (Version 2.0.0-rc.1.25418.105 -> 2.0.0-rc.1.25419.104)
@ericstj
Copy link
Member

ericstj commented Aug 20, 2025

@ViktorHofer analyzer related errors here.

@ViktorHofer
Copy link
Member

@ericstj this is the package layout:

image

That should be correct, right?

@ericstj
Copy link
Member

ericstj commented Aug 20, 2025

Error is

/__w/1/s/.dotnet/sdk/10.0.100-rc.1.25411.109/Microsoft.Common.CurrentVersion.targets(2437,5): error MSB3106: Assembly strong name "/__w/1/s/.packages/microsoft.codeanalysis.netanalyzers/10.0.100-rc.1.25419.104/analyzers/dotnet/cs/Microsoft.CodeAnalysis.NetAnalyzers.dll" is either a path which could not be found or it is a full assembly name which is badly formed. If it is a full assembly name it may contain characters that need to be escaped with backslash(\). Those characters are Equals(=), Comma(,), Quote("), Apostrophe('), Backslash(\). [/__w/1/s/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/LibraryImportGenerator.Unit.Tests.csproj]

So it is trying to find Microsoft.CodeAnalysis.NetAnalyzers.dll in the analyzers/dotnet/cs folder. Let's find out why.

@ericstj
Copy link
Member

ericstj commented Aug 20, 2025

Looks like a hardcoded path here -

<Target Name="AddNetAnalyzersAssemblyAsReference" BeforeTargets="ResolveAssemblyReferences" DependsOnTargets="ResolveProjectReferences">
<ItemGroup>
<Reference Include="$(PkgMicrosoft_CodeAnalysis_NetAnalyzers)/analyzers/dotnet/cs/Microsoft.CodeAnalysis.NetAnalyzers.dll" />
</ItemGroup>
</Target>

I'll update that. I think the new package layout from @ViktorHofer's change is more correct. This project voided the warranty by grabbing direct files like this, so it's responsible for the break. cc @jkoritzinsky

@jkoritzinsky
Copy link
Member

I'm fine with whatever changes need to be made to fix the build.

For reference, we ref this project in this way because we have a diagnostic suppressor for a case where one of the analyzers from there would break SG interop and we didn't want users getting sent down the wrong path.

@ericstj
Copy link
Member

ericstj commented Aug 20, 2025

Yep - it's clear why you did this, only called out responsibility here in case we needed to consider which side should change to fix it. One thing that could make this less fragile would be a package provided for referencing an analyzer, or targets within the analyzer package (which knows its own internal layout) that could raise the reference when a property is set. I'm not sure I'd bother with either since this sort of move/rename is unlikely to happen again.

@ericstj ericstj enabled auto-merge (squash) August 20, 2025 17:54
Updated Dependencies:
Microsoft.CodeAnalysis, Microsoft.CodeAnalysis.Analyzers, Microsoft.CodeAnalysis.CSharp, Microsoft.Net.Compilers.Toolset (Version 5.0.0-2.25419.104 -> 5.0.0-2.25419.113)
Microsoft.CodeAnalysis.NetAnalyzers, Microsoft.DotNet.ApiCompat.Task, Microsoft.NET.Workload.Emscripten.Current.Manifest-10.0.100.Transport (Version 10.0.100-rc.1.25419.104 -> 10.0.100-rc.1.25419.113)
Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.Build.Tasks.Archives, Microsoft.DotNet.Build.Tasks.Feed, Microsoft.DotNet.Build.Tasks.Installers, Microsoft.DotNet.Build.Tasks.Packaging, Microsoft.DotNet.Build.Tasks.TargetFramework, Microsoft.DotNet.Build.Tasks.Templating, Microsoft.DotNet.Build.Tasks.Workloads, Microsoft.DotNet.CodeAnalysis, Microsoft.DotNet.GenAPI, Microsoft.DotNet.GenFacades, Microsoft.DotNet.Helix.Sdk, Microsoft.DotNet.PackageTesting, Microsoft.DotNet.RemoteExecutor, Microsoft.DotNet.SharedFramework.Sdk, Microsoft.DotNet.XliffTasks, Microsoft.DotNet.XUnitExtensions (Version 10.0.0-beta.25419.104 -> 10.0.0-beta.25419.113)
Microsoft.DotNet.Cecil (Version 0.11.5-alpha.25419.104 -> 0.11.5-alpha.25419.113)
Microsoft.DotNet.XUnitAssert, Microsoft.DotNet.XUnitConsoleRunner (Version 2.9.3-beta.25419.104 -> 2.9.3-beta.25419.113)
Microsoft.NET.Sdk.IL, Microsoft.NETCore.App.Ref, Microsoft.NETCore.ILAsm, runtime.native.System.IO.Ports, System.Reflection.Metadata, System.Reflection.MetadataLoadContext, System.Text.Json (Version 10.0.0-rc.1.25419.104 -> 10.0.0-rc.1.25419.113)
NuGet.Frameworks, NuGet.Packaging, NuGet.ProjectModel, NuGet.Versioning (Version 7.0.0-preview.1.42004 -> 7.0.0-preview.1.42013)
System.CommandLine (Version 2.0.0-rc.1.25419.104 -> 2.0.0-rc.1.25419.113)
Updated Dependencies:
Microsoft.CodeAnalysis, Microsoft.CodeAnalysis.Analyzers, Microsoft.CodeAnalysis.CSharp, Microsoft.Net.Compilers.Toolset (Version 5.0.0-2.25419.113 -> 5.0.0-2.25420.121)
Microsoft.CodeAnalysis.NetAnalyzers, Microsoft.DotNet.ApiCompat.Task, Microsoft.NET.Workload.Emscripten.Current.Manifest-10.0.100.Transport (Version 10.0.100-rc.1.25419.113 -> 10.0.100-rc.1.25420.121)
Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.Build.Tasks.Archives, Microsoft.DotNet.Build.Tasks.Feed, Microsoft.DotNet.Build.Tasks.Installers, Microsoft.DotNet.Build.Tasks.Packaging, Microsoft.DotNet.Build.Tasks.TargetFramework, Microsoft.DotNet.Build.Tasks.Templating, Microsoft.DotNet.Build.Tasks.Workloads, Microsoft.DotNet.CodeAnalysis, Microsoft.DotNet.GenAPI, Microsoft.DotNet.GenFacades, Microsoft.DotNet.Helix.Sdk, Microsoft.DotNet.PackageTesting, Microsoft.DotNet.RemoteExecutor, Microsoft.DotNet.SharedFramework.Sdk, Microsoft.DotNet.XliffTasks, Microsoft.DotNet.XUnitExtensions (Version 10.0.0-beta.25419.113 -> 10.0.0-beta.25420.121)
Microsoft.DotNet.Cecil (Version 0.11.5-alpha.25419.113 -> 0.11.5-alpha.25420.121)
Microsoft.DotNet.XUnitAssert, Microsoft.DotNet.XUnitConsoleRunner (Version 2.9.3-beta.25419.113 -> 2.9.3-beta.25420.121)
Microsoft.NET.Sdk.IL, Microsoft.NETCore.App.Ref, Microsoft.NETCore.ILAsm, runtime.native.System.IO.Ports, System.Reflection.Metadata, System.Reflection.MetadataLoadContext, System.Text.Json (Version 10.0.0-rc.1.25419.113 -> 10.0.0-rc.1.25420.121)
NuGet.Frameworks, NuGet.Packaging, NuGet.ProjectModel, NuGet.Versioning (Version 7.0.0-preview.1.42013 -> 7.0.0-preview.1.42121)
System.CommandLine (Version 2.0.0-rc.1.25419.113 -> 2.0.0-rc.1.25420.121)
@ericstj
Copy link
Member

ericstj commented Aug 21, 2025

@dotnet/wasm-eng seems like many wasm tests are failing with the same error here:

[] fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
[]       An unhandled exception has occurred while executing the request.
[]       System.InvalidOperationException: ETag header not found.
[]          at Microsoft.AspNetCore.Builder.StaticAssetDescriptorExtensions.GetWeakETag(StaticAssetDescriptor descriptor)
[]          at Microsoft.AspNetCore.Builder.StaticAssetDevelopmentRuntimeHandler.AttachRuntimePatching(EndpointBuilder builder)
[]          at Microsoft.AspNetCore.StaticAssets.StaticAssetEndpointFactory.Create(StaticAssetDescriptor resource, List`1 conventions, List`1 finallyConventions)
[]          at Microsoft.AspNetCore.StaticAssets.StaticAssetsEndpointDataSource.UpdateEndpoints()
[]          at Microsoft.AspNetCore.StaticAssets.StaticAssetsEndpointDataSource.Initialize()
[]          at Microsoft.AspNetCore.StaticAssets.StaticAssetsEndpointDataSource.GetChangeToken()
[]          at Microsoft.Extensions.Primitives.ChangeToken.ChangeTokenRegistration`1..ctor(Func`1 changeTokenProducer, Action`1 changeTokenConsumer, TState state)
[]          at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
[]          at Microsoft.AspNetCore.Routing.CompositeEndpointDataSource.CreateChangeTokenUnsynchronized(Boolean collectionChanged)
[]          at Microsoft.AspNetCore.Routing.CompositeEndpointDataSource.EnsureChangeTokenInitialized()
[]          at Microsoft.AspNetCore.Routing.CompositeEndpointDataSource.GetChangeToken()
[]          at Microsoft.AspNetCore.Routing.DataSourceDependentCache`1.Initialize()
[]          at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)
[]          at Microsoft.AspNetCore.Routing.Matching.DataSourceDependentMatcher..ctor(EndpointDataSource dataSource, Lifetime lifetime, Func`1 matcherBuilderFactory)
[]          at Microsoft.AspNetCore.Routing.Matching.DfaMatcherFactory.CreateMatcher(EndpointDataSource dataSource)
[]          at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.InitializeCoreAsync()
[]       --- End of stack trace from previous location ---
[]          at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.<Invoke>g__AwaitMatcher|10_0(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task`1 matcherTask)
[]          at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

@lewing
Copy link
Member

lewing commented Aug 21, 2025

@javiercn ptal

@pavelsavara
Copy link
Member

WBT

cc @maraf @javiercn

Log

ystem.InvalidOperationException: ETag header not found.
[]          at Microsoft.AspNetCore.Builder.StaticAssetDescriptorExtensions.GetWeakETag(StaticAssetDescriptor descriptor)
[]          at Microsoft.AspNetCore.Builder.StaticAssetDevelopmentRuntimeHandler.AttachRuntimePatching(EndpointBuilder builder)
[]          at Microsoft.AspNetCore.StaticAssets.StaticAssetEndpointFactory.Create(StaticAssetDescriptor resource, List`1 conventions, List`1 finallyConventions)
[]          at Microsoft.AspNetCore.StaticAssets.StaticAssetsEndpointDataSource.UpdateEndpoints()
[]          at Microsoft.AspNetCore.StaticAssets.StaticAssetsEndpointDataSource.Initialize()
[]          at Microsoft.AspNetCore.StaticAssets.StaticAssetsEndpointDataSource.GetChangeToken()
[]          at Microsoft.Extensions.Primitives.ChangeToken.ChangeTokenRegistration`1..ctor(Func`1 changeTokenProducer, Action`1 changeTokenConsumer, TState state)
[]          at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
[]          at Microsoft.AspNetCore.Routing.CompositeEndpointDataSource.CreateChangeTokenUnsynchronized(Boolean collectionChanged)
[]          at Microsoft.AspNetCore.Routing.CompositeEndpointDataSource.EnsureChangeTokenInitialized()
[]          at Microsoft.AspNetCore.Routing.CompositeEndpointDataSource.GetChangeToken()
[]          at Microsoft.AspNetCore.Routing.DataSourceDependentCache`1.Initialize()
[]          at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)
[]          at Microsoft.AspNetCore.Routing.Matching.DataSourceDependentMatcher..ctor(EndpointDataSource dataSource, Lifetime lifetime, Func`1 matcherBuilderFactory)
[]          at Microsoft.AspNetCore.Routing.Matching.DfaMatcherFactory.CreateMatcher(EndpointDataSource dataSource)
[]          at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.InitializeCoreAsync()
[]       --- End of stack trace from previous location ---
[]          at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.<Invoke>g__AwaitMatcher|10_0(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task`1 matcherTask)
[]          at Microsoft.AspNetCore.Components.WebAssembly.DevServer.Server.Startup.<>c__DisplayClass5_0.<<Configure>b__0>d.MoveNext()
[]       --- End of stack trace from previous location ---
[]          at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

@ericstj
Copy link
Member

ericstj commented Aug 21, 2025

I was able to reproduce this by pulling down the test case. I see that the resource has an ETag value but it is not "IsWeak". Any idea what this might mean?
image

@ericstj
Copy link
Member

ericstj commented Aug 21, 2025

Looks like this data comes from this file --
WasmBasicTestApp.staticwebassets.endpoints.json

@ericstj
Copy link
Member

ericstj commented Aug 21, 2025

@javiercn I guess this is because you stopped setting weak ETag in Release mode, but these tests are running Release builds.

This component which checks for weak ETag seems to be enabled by the presense of "ManifestType": "Build", in the above file. So maybe that ASP.NET component should stop checking for this - I'm not sure how the runtime side of this is in ASP.NET is supposed to work...

I can see that I can set AttachWeakETagToCompressedAssetsDuringDevelopment in the test's generated project build, so maybe that's what we do for now to workaround this. Let's see if we can find the right place to set this...

@javiercn
Copy link
Member

@ericstj Yes.

AttachWeakETagToCompressedAssetsDuringDevelopment is precisely available for that reason. In case we need an override. we should just apply it on the affected projects.

@javiercn
Copy link
Member

@akoeplinger or @maraf can you help with the tests here?

@ericstj
Copy link
Member

ericstj commented Aug 21, 2025

@javiercn I filed dotnet/aspnetcore#63364 because based on what I saw this might impact anyone running dotnet run -c Release on an app with compressed content.

@ericstj
Copy link
Member

ericstj commented Aug 21, 2025

@akoeplinger or @maraf can you help with the tests here?

Would that be to set this property in a place like https://github.com/dotnet/runtime/blob/main/src/mono/wasm/Wasm.Build.Tests/data/Blazor.Directory.Build.props, and other props in the same directory?

@javiercn
Copy link
Member

I've pushed a change to unblock the build

@ericstj
Copy link
Member

ericstj commented Aug 21, 2025

Are you sure that file isn't going to be overwritten with the props files I pointed out above? I was in the middle of testing a change to the repro and had modified all the props here https://github.com/dotnet/runtime/blob/main/src/mono/wasm/Wasm.Build.Tests/data. It looks to me like these are all copied to test root, (EG: C:\scratch\helix\dotnet-backflo\workitems\Workloads-ST-Wasm.Build.Tests.HttpTests\wbt artifacts\HttpTest_Release_False_4keioy03_gim_鿀蜒枛遫䡫煉\Directory.Build.props) when building the test.

@ericstj
Copy link
Member

ericstj commented Aug 21, 2025

When I tried this in my local repro 56a92b3 did not fix the issue, since those props are not used. The changes I suggested above do fix at least the test case I've been looking at.

This is the copy I was mentioning:

File.Copy(Path.Combine(BuildEnvironment.TestDataPath, "Blazor.Directory.Build.props"), Path.Combine(_projectDir, "Directory.Build.props"));
File.Copy(Path.Combine(BuildEnvironment.TestDataPath, "Blazor.Directory.Build.targets"), Path.Combine(_projectDir, "Directory.Build.targets"));

protected static string s_directoryBuildPropsForWorkloads = File.ReadAllText(Path.Combine(TestDataPath, "Workloads.Directory.Build.props"));
protected static string s_directoryBuildTargetsForWorkloads = File.ReadAllText(Path.Combine(TestDataPath, "Workloads.Directory.Build.targets"));
protected static string s_directoryBuildPropsForLocal = File.ReadAllText(Path.Combine(TestDataPath, "Local.Directory.Build.props"));
protected static string s_directoryBuildTargetsForLocal = File.ReadAllText(Path.Combine(TestDataPath, "Local.Directory.Build.targets"));

if (workloadInstalled)
{
DirectoryBuildPropsContents = s_directoryBuildPropsForWorkloads;
DirectoryBuildTargetsContents = s_directoryBuildTargetsForWorkloads;
IsWorkload = true;
}
else
{
DirectoryBuildPropsContents = s_directoryBuildPropsForLocal;
DirectoryBuildTargetsContents = s_directoryBuildTargetsForLocal;
}

File.WriteAllText(Path.Combine(dir, "Directory.Build.props"), s_buildEnv.DirectoryBuildPropsContents);
File.WriteAllText(Path.Combine(dir, "Directory.Build.targets"), s_buildEnv.DirectoryBuildTargetsContents);

Maybe we need both? FWIW I also see the same sort of structure under the WASI tests, but maybe those aren't running in this build pipeline. cc @radical

@ericstj
Copy link
Member

ericstj commented Aug 21, 2025

I have temporarily disabled this subscription https://maestro.dot.net/subscriptions?search=f7901f87-9f24-40d6-9bc1-564863937237&showDisabled=True. Will reenable after merging

@ericstj ericstj merged commit cda0bf4 into main Aug 21, 2025
167 of 168 checks passed
@dotnet-maestro dotnet-maestro bot deleted the darc-main-3cf679c9-4176-4196-8552-e49d000d43de branch August 21, 2025 23:46
@ericstj
Copy link
Member

ericstj commented Aug 21, 2025

I have temporarily disabled this subscription

Subscription has been re-enabled.

@ViktorHofer ViktorHofer restored the darc-main-3cf679c9-4176-4196-8552-e49d000d43de branch August 29, 2025 11:09
@ViktorHofer ViktorHofer deleted the darc-main-3cf679c9-4176-4196-8552-e49d000d43de branch August 29, 2025 11:11
@github-actions github-actions bot locked and limited conversation to collaborators Sep 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-codeflow for labeling automated codeflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants