Skip to content

Commit

Permalink
Merge pull request #11840 from dotnet/main
Browse files Browse the repository at this point in the history
Merge main into 10.0
  • Loading branch information
JeremyKuhne authored Aug 8, 2024
2 parents 481f7e0 + 7aeab49 commit 6e7755c
Show file tree
Hide file tree
Showing 66 changed files with 498 additions and 261 deletions.
204 changes: 104 additions & 100 deletions eng/Version.Details.xml

Large diffs are not rendered by default.

64 changes: 32 additions & 32 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,37 @@
</PropertyGroup>
<!-- Below have corresponding entries in Versions.Details.XML because they are updated via Maestro -->
<PropertyGroup>
<VSRedistCommonNetCoreSharedFrameworkx6490PackageVersion>9.0.0-rc.1.24381.5</VSRedistCommonNetCoreSharedFrameworkx6490PackageVersion>
<SystemDiagnosticsEventLogPackageVersion>9.0.0-rc.1.24381.5</SystemDiagnosticsEventLogPackageVersion>
<SystemDirectoryServicesPackageVersion>9.0.0-rc.1.24381.5</SystemDirectoryServicesPackageVersion>
<SystemFormatsNrbfPackageVersion>9.0.0-preview.7.24373.8</SystemFormatsNrbfPackageVersion>
<SystemReflectionMetadataLoadContextPackageVersion>9.0.0-rc.1.24381.5</SystemReflectionMetadataLoadContextPackageVersion>
<SystemSecurityCryptographyXmlPackageVersion>9.0.0-rc.1.24381.5</SystemSecurityCryptographyXmlPackageVersion>
<SystemIOHashingPackageVersion>9.0.0-rc.1.24381.5</SystemIOHashingPackageVersion>
<SystemIOPackagingPackageVersion>9.0.0-rc.1.24381.5</SystemIOPackagingPackageVersion>
<VSRedistCommonNetCoreSharedFrameworkx6490PackageVersion>9.0.0-rc.1.24407.9</VSRedistCommonNetCoreSharedFrameworkx6490PackageVersion>
<SystemDiagnosticsEventLogPackageVersion>9.0.0-rc.1.24407.9</SystemDiagnosticsEventLogPackageVersion>
<SystemDirectoryServicesPackageVersion>9.0.0-rc.1.24407.9</SystemDirectoryServicesPackageVersion>
<SystemFormatsNrbfPackageVersion>9.0.0-rc.1.24407.9</SystemFormatsNrbfPackageVersion>
<SystemReflectionMetadataLoadContextPackageVersion>9.0.0-rc.1.24407.9</SystemReflectionMetadataLoadContextPackageVersion>
<SystemSecurityCryptographyXmlPackageVersion>9.0.0-rc.1.24407.9</SystemSecurityCryptographyXmlPackageVersion>
<SystemIOHashingPackageVersion>9.0.0-rc.1.24407.9</SystemIOHashingPackageVersion>
<SystemIOPackagingPackageVersion>9.0.0-rc.1.24407.9</SystemIOPackagingPackageVersion>
<MicrosoftNETCoreRuntimeCoreCLRPackageVersion>5.0.0-preview.7.20320.5</MicrosoftNETCoreRuntimeCoreCLRPackageVersion>
<MicrosoftNETCoreILDAsmPackageVersion>9.0.0-rc.1.24381.5</MicrosoftNETCoreILDAsmPackageVersion>
<SystemDiagnosticsPerformanceCounterPackageVersion>9.0.0-rc.1.24381.5</SystemDiagnosticsPerformanceCounterPackageVersion>
<MicrosoftNETCoreILDAsmPackageVersion>9.0.0-rc.1.24407.9</MicrosoftNETCoreILDAsmPackageVersion>
<SystemDiagnosticsPerformanceCounterPackageVersion>9.0.0-rc.1.24407.9</SystemDiagnosticsPerformanceCounterPackageVersion>
<SystemRuntimeCompilerServicesUnsafePackageVersion>6.0.0</SystemRuntimeCompilerServicesUnsafePackageVersion>
<SystemRuntimeSerializationFormattersPackageVersion>9.0.0-rc.1.24381.5</SystemRuntimeSerializationFormattersPackageVersion>
<SystemSecurityCryptographyPkcsPackageVersion>9.0.0-rc.1.24381.5</SystemSecurityCryptographyPkcsPackageVersion>
<SystemSecurityCryptographyProtectedDataPackageVersion>9.0.0-rc.1.24381.5</SystemSecurityCryptographyProtectedDataPackageVersion>
<SystemTextEncodingsWebPackageVersion>9.0.0-rc.1.24381.5</SystemTextEncodingsWebPackageVersion>
<SystemTextJsonPackageVersion>9.0.0-rc.1.24381.5</SystemTextJsonPackageVersion>
<SystemThreadingAccessControlPackageVersion>9.0.0-rc.1.24381.5</SystemThreadingAccessControlPackageVersion>
<MicrosoftWin32RegistryAccessControlPackageVersion>9.0.0-rc.1.24381.5</MicrosoftWin32RegistryAccessControlPackageVersion>
<MicrosoftNETCoreAppRefPackageVersion>9.0.0-rc.1.24381.5</MicrosoftNETCoreAppRefPackageVersion>
<MicrosoftNETCoreAppRuntimewinx64PackageVersion>9.0.0-rc.1.24381.5</MicrosoftNETCoreAppRuntimewinx64PackageVersion>
<MicrosoftNETCorePlatformsPackageVersion>9.0.0-rc.1.24381.5</MicrosoftNETCorePlatformsPackageVersion>
<MicrosoftWin32SystemEventsPackageVersion>9.0.0-rc.1.24381.5</MicrosoftWin32SystemEventsPackageVersion>
<SystemCodeDomPackageVersion>9.0.0-rc.1.24381.5</SystemCodeDomPackageVersion>
<SystemConfigurationConfigurationManagerPackageVersion>9.0.0-rc.1.24381.5</SystemConfigurationConfigurationManagerPackageVersion>
<SystemResourcesExtensionsPackageVersion>9.0.0-rc.1.24381.5</SystemResourcesExtensionsPackageVersion>
<SystemSecurityPermissionsPackageVersion>9.0.0-rc.1.24381.5</SystemSecurityPermissionsPackageVersion>
<SystemWindowsExtensionsPackageVersion>9.0.0-rc.1.24381.5</SystemWindowsExtensionsPackageVersion>
<MicrosoftNETCoreILAsmPackageVersion>9.0.0-rc.1.24381.5</MicrosoftNETCoreILAsmPackageVersion>
<runtimewinx64MicrosoftNETCoreILAsmPackageVersion>9.0.0-rc.1.24381.5</runtimewinx64MicrosoftNETCoreILAsmPackageVersion>
<runtimewinx86MicrosoftNETCoreILAsmPackageVersion>9.0.0-rc.1.24381.5</runtimewinx86MicrosoftNETCoreILAsmPackageVersion>
<SystemRuntimeSerializationFormattersPackageVersion>9.0.0-rc.1.24407.9</SystemRuntimeSerializationFormattersPackageVersion>
<SystemSecurityCryptographyPkcsPackageVersion>9.0.0-rc.1.24407.9</SystemSecurityCryptographyPkcsPackageVersion>
<SystemSecurityCryptographyProtectedDataPackageVersion>9.0.0-rc.1.24407.9</SystemSecurityCryptographyProtectedDataPackageVersion>
<SystemTextEncodingsWebPackageVersion>9.0.0-rc.1.24407.9</SystemTextEncodingsWebPackageVersion>
<SystemTextJsonPackageVersion>9.0.0-rc.1.24407.9</SystemTextJsonPackageVersion>
<SystemThreadingAccessControlPackageVersion>9.0.0-rc.1.24407.9</SystemThreadingAccessControlPackageVersion>
<MicrosoftWin32RegistryAccessControlPackageVersion>9.0.0-rc.1.24407.9</MicrosoftWin32RegistryAccessControlPackageVersion>
<MicrosoftNETCoreAppRefPackageVersion>9.0.0-rc.1.24407.9</MicrosoftNETCoreAppRefPackageVersion>
<MicrosoftNETCoreAppRuntimewinx64PackageVersion>9.0.0-rc.1.24407.9</MicrosoftNETCoreAppRuntimewinx64PackageVersion>
<MicrosoftNETCorePlatformsPackageVersion>9.0.0-rc.1.24407.9</MicrosoftNETCorePlatformsPackageVersion>
<MicrosoftWin32SystemEventsPackageVersion>9.0.0-rc.1.24407.9</MicrosoftWin32SystemEventsPackageVersion>
<SystemCodeDomPackageVersion>9.0.0-rc.1.24407.9</SystemCodeDomPackageVersion>
<SystemConfigurationConfigurationManagerPackageVersion>9.0.0-rc.1.24407.9</SystemConfigurationConfigurationManagerPackageVersion>
<SystemResourcesExtensionsPackageVersion>9.0.0-rc.1.24407.9</SystemResourcesExtensionsPackageVersion>
<SystemSecurityPermissionsPackageVersion>9.0.0-rc.1.24407.9</SystemSecurityPermissionsPackageVersion>
<SystemWindowsExtensionsPackageVersion>9.0.0-rc.1.24407.9</SystemWindowsExtensionsPackageVersion>
<MicrosoftNETCoreILAsmPackageVersion>9.0.0-rc.1.24407.9</MicrosoftNETCoreILAsmPackageVersion>
<runtimewinx64MicrosoftNETCoreILAsmPackageVersion>9.0.0-rc.1.24407.9</runtimewinx64MicrosoftNETCoreILAsmPackageVersion>
<runtimewinx86MicrosoftNETCoreILAsmPackageVersion>9.0.0-rc.1.24407.9</runtimewinx86MicrosoftNETCoreILAsmPackageVersion>
<!--
Microsoft.NET.Sdk.IL.targets requires definition of MicrosoftNETCoreILAsmVersion
-->
Expand All @@ -56,9 +56,9 @@
</PropertyGroup>
<!-- Arcade -->
<PropertyGroup>
<MicrosoftDotNetGenFacadesPackageVersion>9.0.0-beta.24379.1</MicrosoftDotNetGenFacadesPackageVersion>
<MicrosoftDotNetRemoteExecutorVersion>9.0.0-beta.24379.1</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetXUnitExtensionsPackageVersion>9.0.0-beta.24379.1</MicrosoftDotNetXUnitExtensionsPackageVersion>
<MicrosoftDotNetGenFacadesPackageVersion>9.0.0-beta.24408.1</MicrosoftDotNetGenFacadesPackageVersion>
<MicrosoftDotNetRemoteExecutorVersion>9.0.0-beta.24408.1</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetXUnitExtensionsPackageVersion>9.0.0-beta.24408.1</MicrosoftDotNetXUnitExtensionsPackageVersion>
<MicrosoftNETTestSdkVersion>17.4.0-preview-20220707-01</MicrosoftNETTestSdkVersion>
</PropertyGroup>
<!-- Below have no corresponding entries in Versions.Details.XML because they are not updated via Maestro -->
Expand Down
4 changes: 2 additions & 2 deletions eng/common/native/init-compiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ case "$compiler" in
majorVersion="${version%%.*}"

# LLVM based on v18 released in early 2024, with two releases per year
maxVersion="$((18 + ((($(date +%Y) - 2024) * 12 + $(date +%m) - 3) / 6)))"
maxVersion="$((18 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 6)))"
compiler=clang
;;

Expand All @@ -31,7 +31,7 @@ case "$compiler" in
majorVersion="${version%%.*}"

# GCC based on v14 released in early 2024, with one release per year
maxVersion="$((14 + ((($(date +%Y) - 2024) * 12 + $(date +%m) - 3) / 12)))"
maxVersion="$((14 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 12)))"
compiler=gcc
;;
esac
Expand Down
8 changes: 4 additions & 4 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"version": "9.0.100-preview.5.24307.3"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24379.1",
"Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24379.1",
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24379.1",
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24408.1",
"Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24408.1",
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24408.1",
"FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0",
"Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24381.5"
"Microsoft.NET.Sdk.IL": "9.0.0-rc.1.24407.9"
},
"native-tools": {
"cmake": "latest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,6 @@ public async Task CS_ApplicationConfigurationGenerator_GenerateInitialize_user_s

private SourceText LoadFileContent(string testName) =>
SourceText.From(
File.ReadAllText($@"System\Windows\Forms\Generators\MockData\{GetType().Name}.{testName}.cs"),
File.ReadAllText($@"Generators\MockData\{GetType().Name}.{testName}.cs"),
Encoding.UTF8);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public partial class ApplicationConfigurationInitializeBuilderTests
[InlineData("MyProject", "default_boilerplate")]
public void ApplicationConfigurationInitializeBuilder_GenerateInitialize_can_handle_namespace(string? ns, string expectedFileName)
{
string expected = File.ReadAllText($@"System\Windows\Forms\Generators\MockData\{GetType().Name}.{expectedFileName}.cs");
string expected = File.ReadAllText($@"Generators\MockData\{GetType().Name}.{expectedFileName}.cs");

string output = ApplicationConfigurationInitializeBuilder.GenerateInitialize(ns,
new ApplicationConfig(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
</ItemGroup>

<ItemGroup>
<Compile Remove="System\Windows\Forms\Generators\MockData\*.cs" />
<None Include="System\Windows\Forms\Generators\MockData\*.*">
<Compile Remove="Generators\MockData\*.cs" />
<None Include="Generators\MockData\*.*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,4 @@
<ProjectReference Include="..\..\..\src\System.Windows.Forms.Analyzers.VisualBasic.vbproj" />
</ItemGroup>

<ItemGroup>
<None Include="System\Windows\Forms\Generators\MockData\*.*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ private void Deserialize(IServiceProvider? provider, IContainer? container, bool
{
_resourceStream.Seek(0, SeekOrigin.Begin);
#pragma warning disable SYSLIB0011 // Type or member is obsolete
Hashtable? resources = new BinaryFormatter().Deserialize(_resourceStream) as Hashtable;
Hashtable? resources = new BinaryFormatter().Deserialize(_resourceStream) as Hashtable; // CodeQL[SM03722, SM04191] : The operation is essential for the design experience when users are running their own designers they have created. This cannot be achieved without BinaryFormatter
#pragma warning restore SYSLIB0011 // Type or member is obsolete
_resources = new LocalResourceManager(resources);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@ protected void OnMenuPaste(object? sender, EventArgs e)
{
s.Seek(0, SeekOrigin.Begin);
#pragma warning disable SYSLIB0011 // Type or member is obsolete
object serializationData = new BinaryFormatter().Deserialize(s);
object serializationData = new BinaryFormatter().Deserialize(s); // CodeQL[SM03722, SM04191] : The operation is essential for the design experience when users are running their own designers they have created. This cannot be achieved without BinaryFormatter
#pragma warning restore SYSLIB0011 // Type or member is obsolete
using (ScaleHelper.EnterDpiAwarenessScope(DPI_AWARENESS_CONTEXT.DPI_AWARENESS_CONTEXT_SYSTEM_AWARE))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private static void GetAssociatedComponents(IComponent component, IDesignerHost
{
SerializationStream!.Seek(0, SeekOrigin.Begin);
#pragma warning disable SYSLIB0011 // Type or member is obsolete
return new BinaryFormatter().Deserialize(SerializationStream);
return new BinaryFormatter().Deserialize(SerializationStream); // CodeQL[SM03722, SM04191] : The operation is essential for the design experience when users are running their own designers they have created. This cannot be achieved without BinaryFormatter
#pragma warning restore SYSLIB0011 // Type or member is obsolete
}
else if (format.Equals(NestedToolboxItemFormat))
Expand Down Expand Up @@ -211,7 +211,7 @@ public void Deserialize(IServiceProvider? serviceProvider, bool removeCurrentCom
try
{
#pragma warning disable SYSLIB0011 // Type or member is obsolete
_serializationData ??= new BinaryFormatter().Deserialize(SerializationStream!);
_serializationData ??= new BinaryFormatter().Deserialize(SerializationStream!); // CodeQL[SM03722, SM04191] : The operation is essential for the design experience when users are running their own designers they have created. This cannot be achieved without BinaryFormatter
#pragma warning restore SYSLIB0011 // Type or member is obsolete

if (removeCurrentComponents && _components is not null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,33 +215,16 @@ internal static Bitmap ScaleToDpi(Bitmap logicalBitmap, int dpi, bool disposeBit
internal static bool IsScalingRequired => InitialSystemDpi != OneHundredPercentLogicalDpi;

/// <summary>
/// Creates a scaled version of the given <see cref="Font"/> to the Windows Accessibility Text Size setting (also
/// Creates a scaled version of the given non system <see cref="Font"/> to the Windows Accessibility Text Size setting (also
/// known as Text Scaling) if needed, otherwise returns <see langword="null"/>.
/// </summary>
internal static Font? ScaleToSystemTextSize(Font? font)
{
if (!OsVersion.IsWindows10_1507OrGreater() || font is null || font.IsSystemFont)
if (font is null || font.IsSystemFont || !OsVersion.IsWindows10_1507OrGreater())
{
return null;
}

if (font.IsSystemFont)
{
// Recreating the SystemFont will have it scaled to the right size for the current setting. This could be
// done more efficiently by querying the OS to see if this is necessary for the specific font.
//
// This should never return null.
Font newSystemFont = SystemFonts.GetFontByName(font.SystemFontName)!;
if (newSystemFont.Size == font.Size)
{
// No point in keeping an identical one, free the resource.
newSystemFont.Dispose();
return null;
}

return newSystemFont;
}

// The default(100) and max(225) text scale factor is value what Settings display text scale
// applies and also clamps the text scale factor value between 100 and 225 value.
// See https://docs.microsoft.com/windows/uwp/design/input/text-scaling.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using FluentAssertions;
using System.IO.Enumeration;

namespace System.Tests;

public class PathLengthTests
{
[Fact]
public void RepoPathsLeaveRoomForRoot()
{
string currentPath = typeof(PathLengthTests).Assembly.Location;
currentPath = Path.GetFullPath(@"..\..\..\..\..\..\src", currentPath);
Directory.Exists(currentPath).Should().BeTrue();

// Current path will be something like C:\Users\jkuhne\source\repos\winforms\src (41 chars, 38 without src).
// We want to reserve 40 characters of the path length for everything past src.
int currentRootLength = currentPath.Length - "src".Length;

const int MaxRootLength = 40;

int maxLength = 260 - (currentRootLength > MaxRootLength
? MaxRootLength
: MaxRootLength + (MaxRootLength - currentRootLength));

FileSystemEnumerable<string> enumerable = new(
currentPath,
(ref FileSystemEntry entry) => entry.ToFullPath(),
new EnumerationOptions() { RecurseSubdirectories = true })
{
ShouldIncludePredicate = (ref FileSystemEntry entry) =>
// Directory doesn't contain a trailing slash
entry.Directory.Length + entry.FileName.Length > maxLength
};

enumerable.Should().BeEmpty();
}
}
2 changes: 1 addition & 1 deletion src/System.Windows.Forms/src/Resources/SR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4018,7 +4018,7 @@ Stack trace where the illegal operation occurred was:
<value>Occurs whenever the state of a virtual item is changed.</value>
</data>
<data name="ListViewVirtualListSizeDescr" xml:space="preserve">
<value>Sets the count of the item collection when the ListView is in virtual mode.</value>
<value>Sets the count of the item collection when the ListView is in virtual mode. If VirtualMode is set to true, and the VirtualListSize property is greater than 0, you must handle the RetrieveVirtualItem event providing valid items.</value>
</data>
<data name="ListViewVirtualListSizeInvalidArgument" xml:space="preserve">
<value>Value of '{1}' is not valid for '{0}'. {0} should be greater than or equal to 0.</value>
Expand Down
4 changes: 2 additions & 2 deletions src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6e7755c

Please sign in to comment.