At first I was just going to update the original post NuGet Nightmares. But that post has enough whining. That post was about Visual Studio 2022, .NET Framework and NuGet. This post is about Visual Studio 2026 .net 10 and Not NuGet. I don't actually think this is about NuGet anymore, though two different A.I. models disagree. I am feeling comfortable at this point throwing Oracle under the bus. Read to the end to find out why.
I installed Visual Studio 2026 on 2 computers at the same time on 2/12/2026. Ok, one finished about an hour later. They were both using the options from previous installs of 2022, so they were not identical but very close. But they were the same Enterprise version 18.3.0 February 2026 Feature Update. I created new Console Apps. Interestingly one computer said .NET 10.0 (Long Term Support) and the other said .NET 10.0 (Preview). No matter where I looked, I could not see any reason for 'preview'.
The console app made from the Visual Studio instance that said .NET 10.0 (Preview) compiled fine. But upon build of a newly created .NET 10.0 (Long Term Support) console app with no NuGet dependencies this error was thrown:
The "ResolvePackageAssets" task failed unexpectedly. System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at System.ReadOnlySpan`1..ctor(T[] array) at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.ValidateHeader(BinaryReader reader, Byte[] settingsHash) at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.OpenCacheStream(Stream stream, Byte[] settingsHash) at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader..ctor(ResolvePackageAssets task) at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups() at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore() at Microsoft.NET.Build.Tasks.TaskBase.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll Running under executable C:\Program Files\Microsoft Visual Studio\18\Enterprise\MSBuild\Current\Bin\amd64\MSBuild.exe --- A detailed error log follows.
The fix Claude Opus 4.6 offered was to replace the System.Runtime.CompilerServices.Unsafe.dll in C:\Program Files\dotnet\sdk\10.0.103\Sdks\Microsoft.NET.Sdk\tools\net472 (v6.0.1.0) with the one found in C:\Program Files\Microsoft Visual Studio\18\Enterprise\MSBuild\Current\Bin\amd64 (v6.0.3.0).
Now it did compile. However, publishing a pre-compiled site to Azure using the publish feature of Visual Studio threw this error:
LOG: DisplayName = System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Program Files/Microsoft Visual Studio/18/Enterprise/Common7/IDE/
LOG: Initial PrivatePath = NULL
Calling assembly : System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51.
LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Users\xxx\AppData\Local\Microsoft\VisualStudio\18.0_92984304\devenv.exe.config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config. LOG: Post-policy reference: System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/18/Enterprise/Common7/IDE/System.Runtime.CompilerServices.Unsafe.DLL. LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/18/Enterprise/Common7/IDE/System.Runtime.CompilerServices.Unsafe/System.Runtime.CompilerServices.Unsafe.DLL. LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/18/Enterprise/Common7/IDE/PublicAssemblies/System.Runtime.CompilerServices.Unsafe.DLL. WRN: Comparing the assembly name resulted in the mismatch: Build Number ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
I inspected both computers
C:\Users\xxx\AppData\Local\Microsoft\VisualStudio\###\devenv.exe.config
The one that worked (Preview???) had:
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.1.0"/>
<codeBase version="6.0.1.0" href="C:\Program Files\Microsoft Visual Studio\18\Enterprise\SharedAssemblies\System.Runtime.CompilerServices.Unsafe\6.0.1.0\6.1.0\netfx\System.Runtime.CompilerServices.Unsafe.dll"/>
</dependentAssembly>
The one that did not work (LTS) was:
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.2.0" newVersion="6.0.2.0"/>
<codeBase version="6.0.2.0" href="c:\program files\microsoft visual studio\18\enterprise\common7\ide\extensions\wdlhhaii.22h\Assemblies\System.Runtime.CompilerServices.Unsafe.dll"/>
</dependentAssembly>
I made it work by changing the oldVersion maximum:
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.3.0" newVersion="6.0.2.0"/>
<codeBase version="6.0.2.0" href="c:\program files\microsoft visual studio\18\enterprise\common7\ide\extensions\wdlhhaii.22h\Assemblies\System.Runtime.CompilerServices.Unsafe.dll"/>
</dependentAssembly>
Please note that this was on top of the page:
<!-- *************************************************************************** -->
<!-- ************** NOTE: This is a generated file. Do not modify.************** -->
<!-- ********* Modifications will be overwritten during regeneration. ********** -->
<!-- *************************************************************************** -->
A.I. wanted me to let it do publish from the command line because the tooling would be different. At least we agree, it is the tooling, nothing to do with project dependencies.
What extension caused this different binding redirect? The culprit was Oracle VsDevTools which was installed on the problem machine. Now I am wondering if this extension has been my problem all along. And by the way I did finally get it to stop saying .NET 10 (Preview) by deleting contents of ComponentModelCache and then doing a Visual Studio 2026 Repair. It still worked and it still had the same good devenv.exe.config entry for System.Runtime.CompilerServices.Unsafe.