【发布时间】:2018-10-08 13:08:20
【问题描述】:
我有一些用.Net 框架4.0 编写的dll,当我将它引用到用.NET core 2.0 编写的项目时,我无法运行我的程序。
虽然我的 IDE(与 2017 相比)可以在运行时正确识别从该 dll 导入的对象,但我有以下异常:
System.BadImageFormatException: 'Could not load file or assembly 'A_dotnet_4.0_A, Version=10.0.0.0, Culture=neutral, PublicKeyToken=0ad20d08c672086a'. An attempt was made to load a program with an incorrect format.'
我尝试过:
- 将我的设置更改为我在帖子here 中看到的任何 CPU
- 试图彻底重建我的项目。
有可能吗?如果是这样,我应该怎么做。 在下面的link 似乎是可能的 - 我只是不明白怎么做。
【问题讨论】:
-
版本兼容性见this table