You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could not load signature of System.Windows.Forms.Nrbf.SerializationRecordExtensions+TryGetDelegate:BeginInvoke due
to: Could not load file or assembly 'System.Formats.Nrbf, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13
ffcd2ddd51' or one of its dependencies.
After dotnet add package System.Formats.Nrbf, the build again succeeds.
I know, I said as much in my initial post (I just noticed that it was not mentioned in the upgrade guide in particular)
Are you using the binary formatter in your project?
no.
And that is the weird thing
It is not referenced anywhere in source code, or in transitively used nuget packages.
It compiles in .NET8
It just breaks in .NET9
Maybe some additional information:
The CLI error message /call stack:
Precompiling failed for \obj\Release\net9.0-android\android-arm64\linked\System.Private.Windows.Core.dll with exit code -1073741819.
Mono Ahead of Time compiler - compiling assembly \obj\Release\net9.0-android\android-arm64\linked\System.Private.Windows.Core.dll
AOTID 5682CF11-7D3A-E046-8F33-14DD1C85CB2B
Using profile data file '.nuget\packages\microsoft.maui.controls.build.tasks\9.0.22\buildTransitive\netstandard2.0\maui.aotprofile'
Using profile data file '.nuget\packages\microsoft.maui.controls.build.tasks\9.0.22\buildTransitive\netstandard2.0\maui-blazor.aotprofile'
Added 0 methods from profile.
Added 0 methods from profile.
Could not load signature of System.Windows.Forms.Nrbf.SerializationRecordExtensions+TryGetDelegate:BeginInvoke due to: Could not load file or assembly 'System.Formats.Nrbf, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
and then the same for \android-x64\ instead of \android-arm64\
Description
Our app built fine from CLI with
dotnet build -f net8.0-android -c Release
After upgrading to .NET9, and following the guidelines at https://learn.microsoft.com/en-us/dotnet/maui/whats-new/dotnet-9?view=net-maui-9.0,
the CLI build
dotnet build -f net9.0-android -c Release
fails with
After
dotnet add package System.Formats.Nrbf
, the build again succeeds.This seems related to https://devblogs.microsoft.com/dotnet/binaryformatter-removed-from-dotnet-9/ , but is not documented anywhere in the upgrade guide
Do I now have to manually add
System.Formats.Nrbf
to my MAUI project file?Version with bug
9.0.22 SR2.2
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
Latest .NET8 release
Affected platforms
Android, I was not able test on other platforms
Did you find any workaround?
Install
System.Formats.Nrbf
manually.Relevant log output
The text was updated successfully, but these errors were encountered: