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

多平台支持 #284

Open
LazyCuteLion opened this issue Apr 2, 2019 · 2 comments
Open

多平台支持 #284

LazyCuteLion opened this issue Apr 2, 2019 · 2 comments

Comments

@LazyCuteLion
Copy link

平台目标:Any CPU
首选32位:不勾选

调试时报错:
System.BadImageFormatException:“未能加载文件或程序集“Meta.Vlc.Wpf, Version=16.5.1.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。试图加载格式不正确的程序。”

当“平台目标”设置为“x86”或者勾选“首选32位”时,运行正常!

@LazyCuteLion
Copy link
Author

经测试,分别创建了Any CPU、x86、x64 3种不同平台目标的项目,然后使用NuGget包管理器安装Meta.Vlc和Meta.Vlc.Wpf,默认都是引入x86文件,能否实现自动引入对应平台的文件?

@LazyCuteLion
Copy link
Author

找到的解决办法(手动编辑,稍显繁琐):
使用记事本或VS Code 等编辑器打开 “*.csproj” 文件,找到 Meta.Vlc 的相关项,修改如下:

..\packages\Meta.Vlc.18.12.31\lib\net45$(PlatformTarget)\Meta.Vlc.dll


..\packages\Meta.Vlc.Wpf.18.12.31\lib\net45$(PlatformTarget)\Meta.Vlc.Wpf.dll

之后在项目属性里,修改“平台目标”为“x86"或”x64",不支持Any CPU。

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

1 participant