简体   繁体   中英

Exception with 64Bit Unit Test in Visual Studio 2008 Professional

I am trying to Unit-Test a 64 Bit C++/CLI-Project and therefore have a Unit-Test-Project. With 32-Bit Settings everything works fine, but when switching to 64 Bit I get an exception:

Class Initialization method MyTestProject.MyTest.MyClassInitialize threw exception. System.BadImageFormatException:

Tried setting the test project to Any CPU and x64 , same result. Found this link: http://msdn.microsoft.com/en-us/library/ee782531%28v=vs.100%29.aspx where it is described to set the unit test running as 64 bit process.

I don't see this settings and think this is because I don't have the Ultimate Version. I only have Professional.

Any ideas?

Thanks in advance, Joerg


Edit: Sorry, was working with VS2008 and therefore this question was stupid. Please see link in my answer...

I think because you use a dll how don't support 64bit. you have to check used dlls

I am sorry for confusion! This was my error: I generally work with VS2010 but this project is in VS2008. And I just found out that 64Bit unit tests are not possible there. See this link: http://blogs.msdn.com/b/keithmg/archive/2009/04/02/x64-unit-tests-in-visual-studio-2008-microsoft-visualstudio-qualitytools-unittestframework-dll.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM