Skip to content

[browser/blazor] enable GenerateRuntimeConfigurationFiles #48916

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ Copyright (c) .NET Foundation. All rights reserved.
<WasmFingerprintDotnetJs Condition="'$(_TargetingNET80OrLater)' == 'true' and '$(_TargetingNETBefore100)' == 'true'">false</WasmFingerprintDotnetJs>
<WasmEnableWebcil Condition="'$(WasmEnableWebcil)' == '' and ('$(TargetFrameworkIdentifier)' != '.NETCoreApp' or '$(_TargetingNET80OrLater)' != 'true')">false</WasmEnableWebcil>

<!-- Turn off parts of the build that do not apply to Blazor projects -->
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
<!-- Turn off parts of the build that do not apply to Blazor projects until Net10 -->
<GenerateRuntimeConfigurationFiles Condition="'$(GenerateRuntimeConfigurationFiles)' == '' and '$(_TargetingNETBefore100)' == 'true'">false</GenerateRuntimeConfigurationFiles>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<GenerateRuntimeConfigurationFiles Condition="'$(GenerateRuntimeConfigurationFiles)' == '' and '$(_TargetingNETBefore100)' == 'true'">false</GenerateRuntimeConfigurationFiles>
<GenerateRuntimeConfigurationFiles Condition="''$(_TargetingNETBefore100)' == 'true'">false</GenerateRuntimeConfigurationFiles>

I think we should maintain the behavior from previous SDK when targeting downlevel versions


<!-- Don't generate a NETSDK1151 error if a non self-contained Exe references a Blazor Exe -->
<ShouldBeValidatedAsExecutableReference>false</ShouldBeValidatedAsExecutableReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ public void Build_IsIncremental()
newThumbPrint.Count.Should().Be(thumbPrint.Count);
for (var j = 0; j < thumbPrint.Count; j++)
{
thumbPrint[j].Equals(newThumbPrint[j]).Should().BeTrue();
var first = thumbPrint[j];
var actual = newThumbPrint[j];
actual.Path.Equals(first.Path).Should().BeTrue($"because {actual.Path} should match {first.Path}");
actual.Hash.Equals(first.Hash).Should().BeTrue($"because {actual.Hash} should match {first.Hash} for {first.Path}");
actual.LastWriteTimeUtc.Equals(first.LastWriteTimeUtc).Should().BeTrue($"because {actual.LastWriteTimeUtc} should match {first.LastWriteTimeUtc} for {first.Path}");
}
}
}
Expand Down
9 changes: 8 additions & 1 deletion test/Microsoft.NET.TestFramework/Utilities/FileThumbPrint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ public bool Equals(FileThumbPrint? other)
string.Equals(Hash, other.Hash, StringComparison.Ordinal);
}

public override int GetHashCode() => LastWriteTimeUtc.GetHashCode();
public override int GetHashCode()
{
#if NET
return HashCode.Combine(Path, LastWriteTimeUtc, Hash);
#else
return Path.GetHashCode() ^ LastWriteTimeUtc.GetHashCode() ^ Hash.GetHashCode();
#endif
}

private string GetDebuggerDisplay()
{
Expand Down
Loading