reactiveui / ReactiveUI

An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. ReactiveUI allows you to abstract mutable state away from your user interfaces, express the idea around a feature in one readable place and improve the testability of your application.
https://www.reactiveui.net
MIT License
8.07k stars 1.12k forks source link

[Bug]: System.IO.FileNotFoundException:“Could not load file or assembly 'ReactiveUI.XamForms, Version=20.1.0.0, Culture=neutral, PublicKeyToken=null'. 系统找不到指定的文件。” #3926

Open yangl1025 opened 4 days ago

yangl1025 commented 4 days ago

Describe the bug 🐞

.net 8 wpf ,ReactiveUI.WPF 20.1.63。windows desktop app, run err : “scan.server.exe”(CoreCLR: clrhost): 已加载“C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.6\UIAutomationProvider.dll”。 引发的异常:“System.IO.FileNotFoundException”(位于 System.Private.CoreLib.dll 中) 引发的异常:“System.IO.FileNotFoundException”(位于 System.Private.CoreLib.dll 中) 引发的异常:“System.IO.FileNotFoundException”(位于 System.Private.CoreLib.dll 中) 引发的异常:“System.IO.FileNotFoundException”(位于 System.Private.CoreLib.dll 中) 引发的异常:“System.IO.FileNotFoundException”(位于 System.Private.CoreLib.dll 中) 引发的异常:“System.IO.FileNotFoundException”(位于 System.Private.CoreLib.dll 中) 引发的异常:“System.IO.FileNotFoundException”(位于 System.Private.CoreLib.dll 中) 引发的异常:“System.IO.FileNotFoundException”(位于 System.Private.CoreLib.dll 中) 引发的异常:“System.IO.FileNotFoundException”(位于 System.Private.CoreLib.dll 中) 1111

why ReactiveUI.XamForms? I not use this。

Step to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Reproduction repository

https://github.com/reactiveui/ReactiveUI

Expected behavior

This should happen...

Screenshots 🖼️

No response

IDE

No response

Operating system

No response

Version

No response

Device

No response

ReactiveUI Version

No response

Additional information ℹ️

No response

dpvreony commented 3 days ago

looks like same issue as https://github.com/reactiveui/ReactiveUI/issues/3786#issuecomment-2059046449


see if the following workaround prevents the issue. you need one of these in app initialisation before ReactiveUI is called.

if you're not doing any custom Splat DI config.

ReactiveUI.PlatformRegistrationManager.SetRegistrationNamespaces(RegistrationNamespace.WPF);

if you're doing any custom config to Splat etc. you'll need something along the lines of. (you might want this version anyway so it's clearer when ReactiveUI is being set up)

Locator.CurrentMutable.InitializeSplat();
Locator.CurrentMutable.InitializeReactiveUI(RegistrationNamespace.WPF);