System.BadImageFormatException с Oracle.DataAccess и несовпадение с AMD64 - PullRequest
1 голос
/ 19 июня 2019

Я строю свой проект UnitTest vbproj на Visual Studio 2017 Professional.Когда я собираю с помощью «Любого процессора», появляется одно предупреждение:

warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Oracle.DataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=AMD64", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

Затем я запускаю свой тестовый пример, все они проваливаются.Одна из ошибок контрольного примера:

Message: Test method [name of method] threw exception: 
System.BadImageFormatException: Could not load file or assembly 'Oracle.DataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Поэтому я перехожу на платформу x64 -> 45 ошибок и 8 предупреждений, потому что это не подходит для моего проекта.Затем я перехожу на платформу x86 -> Я получил ту же ошибку с платформой x84.

Что мне теперь делать?Я пытался исправить это многими способами, но не могу.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...