Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: “ReactiveUI.ViewForMixins”的类型初始值设定项引发异常 #3934

Open
yangl1025 opened this issue Nov 21, 2024 · 2 comments

Comments

@yangl1025
Copy link

Describe the bug 🐞

System.TypeInitializationException: “ReactiveUI.ViewForMixins”的类型初始值设定项引发异常。 ---> System.BadImageFormatException: 未能加载文件或程序集“System.ValueTuple, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51”或它的某一个依赖项。不应出于执行的目的加载引用程序集。只能在仅限反射的加载程序上下文中加载引用程序集。 (异常来自 HRESULT:0x80131058) ---> System.BadImageFormatException: 无法加载引用程序集来执行。

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

when i run the vs ,it's ok。but I use the setup program ,when I install the msi ,the program throw exception。

Screenshots 🖼️

No response

IDE

Visual Studio 2022

Operating system

windows

Version

11

Device

windows

ReactiveUI Version

19.6.1

Additional information ℹ️

No response

@yangl1025 yangl1025 added the bug label Nov 21, 2024
@dpvreony
Copy link
Member

dpvreony commented Nov 21, 2024

System.BadImageFormatException is where you are deploying a x86 app trying to access x64 binaries (or x64 trying to load x86) . i'd look at your release build profile and what is being put into your installer. try and keep assemblies to AnyCPU where you can. exe target would typically be what would change, but even this isn't usually necessary unless you're accessing the registry etc.

have a read through https://stackoverflow.com/questions/8996653/troubleshooting-badimageformatexception for ideas on troubleshooting

@dpvreony dpvreony removed the bug label Nov 21, 2024
@yangl1025
Copy link
Author

image
image

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

No branches or pull requests

2 participants