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
[dotnet-sdk-9.0.100-preview.7.24379.15] WolvenKit app gets an error "Unable to load one or more of the requested types. Could not load file or assembly 'System.Runtime.Serialization.Formatters, ...'"
#9498
Closed
Junjun-zhao opened this issue
Aug 1, 2024
· 5 comments
When run the 3rd party application with the latest .NET 9 build "dotnet-sdk-9.0.100-preview.7.24379.15", it throws below exception:
Could not load file or assembly 'System.Runtime.Serialization.Formatters, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
Reproduction Steps
Minimal Repro Steps:
1.Create a WPF project.
2. Add below code in MainWindow.xaml.cs file:
public MainWindow()
{
InitializeComponent();
var test = new ObservableCollection<string>(AppDomain.CurrentDomain.GetAssemblies().SelectMany(s => s.GetTypes()).Select(x => x.Name));
}
Build the project.
Update the runtime.config file to let the project run against with 9.0.100-preview.7.24379.15:
Unable to load one or more of the requested types.
Could not load file or assembly 'System.Runtime.Serialization.Formatters, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
Stack Trace:
at System.Reflection.RuntimeModule.GetDefinedTypes()
at System.Reflection.RuntimeModule.GetTypes()
at LoadTypeExceptionDemo.MainWindow.<>c.<.ctor>b__0_0(Assembly s) in E:\Demos\LoadTypeExceptionDemo\LoadTypeExceptionDemo\MainWindow.xaml.cs:line 23
at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
at System.Linq.Enumerable.IteratorSelectIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Collections.ObjectModel.ObservableCollection`1..ctor(IEnumerable`1 collection)
at LoadTypeExceptionDemo.MainWindow..ctor() in E:\Demos\LoadTypeExceptionDemo\LoadTypeExceptionDemo\MainWindow.xaml.cs:line 23
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
Regression?
Yes
Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-6.0.425:Pass
2). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.303:Pass
3). Windows 10 21H2 AMD64 +dotnet-sdk-9.0.100-preview.6.24317.13: Pass
4). Windows 10 21H2 AMD64 +dotnet-sdk-9.0.100-preview.7.24379.15: Fail
Click Cancel button for WolvenKit.Installer pop up window.
Click Cancel button for WolvenKit update window if it pops up.
Click Close button for First Setup pop up window.
Maximize app.
Click Open a project.
Select test1.cpmodproj file from test1 folder and Open it.
Double-click 1.aiarch item from left panel.
Click Create Handle button on right panel.
Expected Result:
Create Class window will pop up.
Actual Result:
Create Class window not show and below error is displayed in Log window.
Error in Log window:
[8/1/2024 1:32:51 PM] Unhandled exception in WolvenKit v8.7.0.0
[8/1/2024 1:32:51 PM] Message: Unable to load one or more of the requested types.
Could not load file or assembly 'System.Runtime.Serialization.Formatters, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
Source: System.Private.CoreLib
StackTrace: at System.Reflection.RuntimeModule.GetDefinedTypes()
at System.Reflection.RuntimeModule.GetTypes()
at WolvenKit.ViewModels.Shell.ChunkViewModel.<>c.<ExecuteAddHandle>b__161_0(Assembly s) in E:\AppsSourceCode\WolvenKit\WolvenKit.App\ViewModels\Shell\ChunkViewModel.cs:line 1310
at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
at System.Linq.Enumerable.IEnumerableWhereSelectIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Collections.ObjectModel.ObservableCollection`1..ctor(IEnumerable`1 collection)
at WolvenKit.ViewModels.Shell.ChunkViewModel.ExecuteAddHandle() in E:\AppsSourceCode\WolvenKit\WolvenKit.App\ViewModels\Shell\ChunkViewModel.cs:line 1310
at Prism.Commands.DelegateCommand.Execute()
at Prism.Commands.DelegateCommand.Execute(Object parameter)
at Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute(Object parameter)
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
@rchauhan18 This is a new BinaryFormatter issue for WolvenKit app. Could you please help look into it? There was a runtime bug which blocked the test and fixed on the latest build. Then this issue is found during the test execution.
Description
When run the 3rd party application with the latest .NET 9 build "dotnet-sdk-9.0.100-preview.7.24379.15", it throws below exception:
Reproduction Steps
Minimal Repro Steps:
1.Create a WPF project.
2. Add below code in MainWindow.xaml.cs file:
Expected behavior
App launch successfully.
Actual behavior
App launch failed with following error:
Regression?
Yes
Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-6.0.425:Pass
2). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.303:Pass
3). Windows 10 21H2 AMD64 +dotnet-sdk-9.0.100-preview.6.24317.13: Pass
4). Windows 10 21H2 AMD64 +dotnet-sdk-9.0.100-preview.7.24379.15: Fail
Known Workarounds
Steps with workaround:
5. Run the app with the App Repro steps above, it will work.
Impact
No response
Configuration
Application Name: WolvenKit
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-9.0.100-preview.7.24379.15
App Source or App checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2176393
Github Link:
https://github.com/WolvenKit/WolvenKit
Other information
App Repro steps:
The machine has dotnet-sdk-9.0.100-preview.7.24379.15 installed.
Expected Result:
Create Class window will pop up.
Actual Result:
Create Class window not show and below error is displayed in Log window.
Error in Log window:
Findings:
The error message is similar with [dotnet-sdk-9.0.100-preview.6.24325.8] SCM2020 launch failed with error: Could not load file or assembly 'System.Runtime.Serialization.Formatters, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' · Issue #9311 · dotnet/wpf (github.com) But this bug was fixed on dotnet-sdk-9.0.100-preview.7.24374.17, and the affected app SCM2020 in the bug is passed on dotnet-sdk-9.0.100-preview.7.24379.15.
WolvenKit was blocked by System.InvalidOperationException: Could not execute the method because either the method itself or the containing type is not fully instantiated. · Issue #103891 · dotnet/runtime (github.com) and fixed on build dotnet-sdk-9.0.100-preview.7.24379.15. During the test execution, we found this issue.
It works with the steps mentioned in the workaround.
We tried same repro code with WinForms project, it doesn't reproduce this error.
@dotnet-actwx-bot @dotnet/compat
The text was updated successfully, but these errors were encountered: