Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL forum
Unanswered

Unble to run exe program from visual studio 2010 in 64 bit OS

Posted on by 60

Hi,

We unable to compile program from visual studio 2010 when installed on 64bit OS.

We have the following error message :

Error 1 Could not load file or assembly 'file:///C:/Windows/assembly/GAC_32/Interop.SAF/7.0.0.0__31bf3856ad364e35/Interop.SAF.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. Line 135, position 5. D:\SQL DATA\Parthi - NEM Enhancement\EM092200\Form1.frm.resX 135 5 em092200

 We are using Solomon 7.0 Feature Pack 1. We can compile the program on 32 bit OS.

Anyone can advise on this?

 

Regards,

Pei Lin

  • Re: Unble to run exe program from visual studio 2010 in 64 bit OS

    Hello Pei Lin,

    There are a number of problems in trying to use Visual Studio 2010 to create a SDK project on a 64 bit machine.   The first was that you need to set the target CPU to "x86".   Then you might get an relating to Mixed Mode because the project is targeting .NET Framework 4.0.  If you switch this to .NET Framework 3.5, then that should take care of the "Mixed mode assembly is built against version..." error.   At that point you should be able to compile and run the app.   But once you start adding any of the SAF controls to the project, you will likely run into another error about not being able to find the interop.saf.dll.   In this case visual studio gets confused and thinks the SAF objects (like the SAFMaskedText) are 64 bit when they are not.  The following posting has some more info on this along with some ways to workaround that issue:

    blogs.msdn.com/.../resgen-exe-error-an-attempt-was-made-to-load-a-program-with-an-incorrect-format.aspx

    Another option is to use a 32bit machine (as you have found out) and you won't run into any of these issues.   Or use Visual Studio 2008 and you shouldn't run into these issues either.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,835 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,526 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans