Thursday, July 30, 2015

Could not load file or assembly 'Whatever' or one of its dependencies. An attempt was made to load a program with an incorrect format.

This error raised its head for me when I attempted to make a new unit test project and have it test an existing C# class library project in Visual Studio 2015. As it turns out, if you right-click on a project and then go to the "Build" tab there is a place where you may explictly set the project to be x64 in lieu of x86 and the project I was testing had this setting and I had to give it to my unit test project to get around this error. Then when I attempted to test with MSTest by going to: Test > Run > All Tests ...my initial test just would not run. To get it to run I went to: Test > Test Settings > Default Processor Architecture ...and then picked x64.

No comments:

Post a Comment