Skip to content

Retarget ACE.Common, ACE.Entity and ACE.DatLoader to net10.0 - #4562

Merged
Mag-nus merged 1 commit into
ACEmulator:masterfrom
Mag-nus:retarget-net10
Nov 29, 2026
Merged

Mag-nus merged 1 commit into
ACEmulator:masterfrom
Mag-nus:retarget-net10

Conversation

@Mag-nus

@Mag-nus Mag-nus commented Nov 29, 2026

Copy link
Copy Markdown
Member

The problem

Since #4545, a server built by publishing the whole solution into one folder fails at its first database access:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.15, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
   at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.<GetOrAdd>g__BuildServiceProvider|4_1(...)
   ...
   at ACE.Database.Models.Shard.ShardDbContext..ctor()
  • ACE.Common, ACE.Entity and ACE.DatLoader still target netstandard2.0, a choice made in the 2017 move off .NET Framework (Major migration from .net framework 4.6.1 to .net standard/core 2.0 #573). Everything that references them targets net10.0.
  • Bump Microsoft.Extensions.Logging from 9.0.22 to 11.0.0 #4545 moved ACE.Common to Microsoft.Extensions.Logging 10.0.15. For netstandard2.0, that brings in the netstandard2.0 builds of Microsoft.Extensions.DependencyInjection and Microsoft.Extensions.DependencyInjection.Abstractions 10.0.15. These reference Microsoft.Bcl.AsyncInterfaces 10.0.15 (assembly version 10.0.0.15), and their net10.0 builds don't.
  • dotnet publish Source/ACE.sln -o <dir> publishes every project into the same folder, the netstandard2.0 libraries included. The SDK warns about this with NETSDK1194.
    • The libraries' copies of those two DLLs overwrite the server's net10.0 copies.
    • Microsoft.Bcl.AsyncInterfaces.dll lands in the folder too, but ACE.Server.deps.json doesn't list it, so the runtime won't load it.
    • The first DbContext then throws.
  • Reproduced on master (e5db0ca): the solution publish leaves the netstandard2.0 copies in the folder. On the commit before Bump Microsoft.Extensions.Logging from 9.0.22 to 11.0.0 #4545 it comes out clean. Publishing only ACE.Server.csproj, as the Dockerfile and AppVeyor do, was never affected.

The fix

  • TargetFramework goes from netstandard2.0 to net10.0 in the three projects. All projects then resolve the same net10.0 package assets, so merging their outputs can no longer swap a different build in.

  • The package references that net10.0 provides in-box are dropped:

    • System.Text.Json (ACE.Common)
    • System.Numerics.Vectors (ACE.Entity)
    • System.Text.Encoding.CodePages (ACE.DatLoader)

    The server already used the in-box copies: none of the three is in master's ACE.Server.deps.json.

What it changes for other consumers

  • Only .NET 10 consumers can use these libraries now. Anything outside this repo that references them and runs on .NET Framework, Mono, Unity, or .NET 9 or older loses them.
    • Inside the repo, every project that references them targets net10.0.
    • CI publishes only ACE.Server, and none of the three is published to NuGet.
    • Mods compile against ACE.Server, which is already net10.0.
  • Behaviour changes only where a call inside the libraries binds to a new overload. The libraries already run on the .NET 10 runtime. What changes is the API they compile against, so a call inside them can now bind to an overload that netstandard2.0 didn't have. Decompiled comparison pending.

Testing

Pending: build and warnings against master, the four test projects, a decompiled diff of the three libraries, and the solution-wide publish that broke.

Files

  • Source/ACE.Common/ACE.Common.csproj
  • Source/ACE.Entity/ACE.Entity.csproj
  • Source/ACE.DatLoader/ACE.DatLoader.csproj

🤖 Generated with Claude Code

The three libraries still targeted netstandard2.0, from the 2017 move off
.NET Framework. Everything that references them targets net10.0.

Since ACE.Common moved to Microsoft.Extensions.Logging 10.0.15 (ACEmulator#4545),
publishing the whole solution into one folder (dotnet publish ACE.sln -o,
warning NETSDK1194) lets the netstandard2.0 copies of
Microsoft.Extensions.DependencyInjection(.Abstractions) overwrite the
server's net10.0 ones. Those reference Microsoft.Bcl.AsyncInterfaces, which
ACE.Server.deps.json does not list, so the first DbContext throws
FileNotFoundException. With every project on net10.0, all of them resolve
the same package assets.

Also drops the package references that net10.0 provides in-box:
System.Text.Json (ACE.Common), System.Numerics.Vectors (ACE.Entity) and
System.Text.Encoding.CodePages (ACE.DatLoader). The server already used the
in-box copies: none of the three is in master's ACE.Server.deps.json.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Mag-nus
Mag-nus merged commit 56588d1 into ACEmulator:master Nov 29, 2026
2 checks passed
@Mag-nus
Mag-nus deleted the retarget-net10 branch November 29, 2026 13:25
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.

1 participant