Skip to content

Conversation

@myd7349
Copy link

@myd7349 myd7349 commented Apr 20, 2025

After updating Visual Studio to version 17.13.5, C# 14.0 became available. However, this introduced a compilation issue in the project. As noted in dotnet/runtime#107723, C# 14.0 introduces first-class support for spans. As a result, when calling Reverse on a byte[], the compiler now resolves it to the span-based method void MemoryExtensions.Reverse<T>(this Span<T>) rather than the LINQ version, IEnumerable<T> Enumerable.Reverse<T>(this IEnumerable<T>). This change causes the project to fail to compile in the latest versions of Visual Studio, including 17.13.5 and 17.13.6.

This PR resolves the issue by first calling AsEnumerable to convert the array to an IEnumerable, ensuring that the correct version of Reverse is used. This should fix #140 .

Alternatively, for this project, another fix would be to lower the C# language version by modifying <LangVersion>preview</LangVersion> in WpfHexEditorCore.csproj to a version below C# 14.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not able to build the core project

1 participant