c# - Could not load file or assembly ... An attempt was made to load a program with an incorrect format (System.BadImageFormatException) -


i have 2 projects, projecta , projectb. projectb console application, depends on projecta. yesterday, working fine, today when run projectb this:

badimageformatexception unhandled:
not load file or assembly 'projecta, version=1.0.0.0, culture=neutral, publickeytoken=null' or 1 of dependencies. attempt made load program incorrect format.

both regular projects, no dependencies on other non-.net projects. both .net - there no native code, , no p/invoke. have other projects depend on projecta , still work fine.

things have tried:

  • make sure both projects set "any cpu," build checkbox checked. are.
  • make sure both projects same target framework (.net 4.0 client profile).
  • under projectb --> references --> projecta --> properties, make sure "copy local" set "true" _ (i verified projecta.dll being copied correctly)
  • clean/rebuild solution. tried manually deleting /bin , /obj folders in both projects.
  • restart visual studio. restart computer.
  • check out entirely new copy of repository.

but still same error. have no idea did cause this, nor how fix it. ideas?

i pretty sure you're having 32-bit / 64-bit conflict. sounds main project might set 32-bit while class referencing set 64-bit. try looking @ this question , this 1 too. between 2 of them, should able figure out problem.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -