BootBlock.co.uk

Software & Rants
  • rss
  • Home
  • About Me
  • Content
  • Software
    • Donation
  • Forum
  • Wiki
  • Contact

Visual Studio 2005 & Windows Vista x64

BootBlock | 7 October, 2007

Visual StudioAfter moving over to the 64-BIT edition of Windows Vista, I encountered problems with Visual Studio 2005.

The first problem was to do with the Visual Studio window not redrawing itself when an executed application had finished running and VS did not have focus.

The second, and most annoying problem was with external libraries, as I couldn’t continue development of some projects because of it. Thankfully, I was able to work out how to fix all of the problems except for one. It’s just a shame that it took me months to re-visit the problem as development suffered for it.

When trying to use an ActiveX DLL, DirectX, or other library within Visual Studio, an exception occurs during runtime of either BadImageFormat exception, a Type Initializer exception, or something equally baffling. Why does this happen and how is it fixed? Read on, why don’cha?

When a .NET application that has been compiled to run with the Any CPU configuration and it’s running on an x64 host, the application will try to load 64-BIT versions of any libraries that it requires, even if those libraries are in the 32-BIT format. When this mis-match occurs, it throws the BadImageFormat exception.

How is this fixed?

To fix this, you will need to explicitly set the main project’s (the Windows Application) configuration to target the 32-BIT platform. The project will now attempt to load the 32-BIT versions of all dependant libraries.

This is a less than optimal solution as it breaks processor optimisations, but it is the only way I know of getting around this application breaking problem.

Please note that the above explanation is my interpretion of the problem as opposed to the problem as reported by an official source.

If you have any further information on this problem, then feel free to post a comment and I’ll update this posting.

Categories
.NET, Programming
Tags
BadImageFormat, Exception, Programming, Visual Studio, VS 2005
Comments rss
Comments rss
Trackback
Trackback

« A fresh lobster? Sure! The Peter Serafinowicz Show »

Leave a Reply

Click here to cancel reply.

Twitter Crap

Click here for my Twitter feed. I update it much more than I update this site - you'll even get some ranting, too!

Latest Releases

Comical 1.07;62
YouChoob 1.16
Wake On LAN Ex 2 2.10
Profile Relocator 1.00
Wake On LAN Ex 0.96
Vista Midi Picker 1.00
 

Categories

  • Arts (7)
    • Food & Drink (4)
    • Literature (2)
    • Music (1)
  • Entertainment (11)
    • Gaming (9)
      • World of Warcraft (3)
        • Cataclysm Beta (3)
    • Television (2)
  • Life (3)
    • Events (1)
    • Thoughts (1)
  • Opinion (5)
    • Rant (4)
  • Programming (3)
    • .NET (3)
  • Software (21)
    • Release (16)
  • Uncategorized (1)
  • Website (17)
    • External Link (3)
      • Flash (1)
    • News (8)
    • Support (1)
  • Weird (2)

Archives

  • August 2010 (1)
  • July 2010 (3)
  • May 2010 (1)
  • February 2010 (1)
  • January 2010 (3)
  • December 2009 (2)
  • November 2009 (2)
  • October 2009 (2)
  • September 2009 (3)
  • July 2009 (2)
  • June 2009 (1)
  • May 2009 (1)
  • April 2009 (1)
  • March 2009 (1)
  • February 2009 (3)
  • January 2009 (2)
  • November 2008 (1)
  • October 2008 (1)
  • September 2008 (2)
  • July 2008 (3)
  • June 2008 (1)
  • May 2008 (5)
  • April 2008 (6)
  • March 2008 (2)
  • November 2007 (1)
  • October 2007 (6)

Links

  • Kev Blog
  • President of the Internet
  • Retroleum
  • The Wibble

Link Me!

Use this badge for linking back to BootBlock.co.uk ... Use this badge for linking back to BootBlock.co.uk ...
Use this badge for linking back to BootBlock.co.uk ... Use this badge for linking back to BootBlock.co.uk ...
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress