System.BadImageFormatException caused by NUnit project

前端 未结 10 1214
孤城傲影
孤城傲影 2020-12-10 02:03

Good day everyone. I have been having the same problem all day at work and am struggling to find any new paths to go down.

I am getting the following error when my

10条回答
  •  心在旅途
    2020-12-10 02:22

    I had this problem with a console app on X64 pc, the build was set as x86 and it still crashed. I went into Properties on the Console App and under build I changed my Platform Target from x86 to Any CPU then suddenly all the tests worked and ran successfully.

    of note, the Configuration Manager's platform field can "lie" to you and doesn't actually have to reflect what the project's properties are actually configured to do. My configuration manager said that "Common.dll" was being built as "Any CPU", but the project properties (the setting that really matters) was building it as "x86".

    enter image description here

提交回复
热议问题