Winform not working on 64 bit machine

Hi,

I have developed a windows application using (visual Studio).   I have just recently installed it on a 64 bit machine, it installed perfectly but when I try and run the application I get an error of something like :  ”The program cannot load”  (I havent got the 64 bit machine with me at the moment

My development machine is 32 bit so it runs perfectly fine on this so I am unable to debug.  

I am hoping that someone is able to offer some advice on this as all my users will soon be upgraded to 64 bit.

Thanks in advance.
SmashAndGrabAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

p_davisCommented:
did you register your assemblies?
Éric MoreauSenior .Net ConsultantCommented:
Is the correct .Net framework installed on this computer? have you deployed any references? Try to build a simple application that shows up a dummy form instead of a more complex application.
AndyAinscowFreelance programmer / ConsultantCommented:
I guess you have a third party component that is 32 bit.  The default settings of the solution you compiled (any CPU) would make it run as 64 bit on a 64 bit machine - which then doesn't run because part of it is 32 bit.  If I am correct then you need to change the target to x86.

SNAG-0006.bmp
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

SmashAndGrabAuthor Commented:
Hi,

Thanks for the comments.

Here is what I have tried so far:

I have changed the build config to x86:

Compiled the program as an x86

But I still get the same error:

Error
SmashAndGrabAuthor Commented:
"P Davis - did you register your assemblies?"

Apologies - I am fairly new to win forms - could you explain how I would do this please?

Thanks
AndyAinscowFreelance programmer / ConsultantCommented:
>>But I still get the same error:

The error you show as a screen shot is very different than in the body of your question.  Please change it back to 'Any CPU' and confirm it is the same error.  If it is a different error please post a screen shot of that error message.
SmashAndGrabAuthor Commented:
Hi Andy,

 I have just rebuilt the solution as "ANY CPU" and have reinstalled it on the 64 bit machine.

build
I can confirm it is the same error message.

Error
Sorry for any ambiguity about my original message - I should have really waited until I had access to the laptop before posting.

Apologies.
AndyAinscowFreelance programmer / ConsultantCommented:
OK.  My comment and those by the other experts are most likely not relevant.  You have some problem after the app has been loaded and is running.
Éric MoreauSenior .Net ConsultantCommented:
have you tried to build a simple application that shows up a dummy form instead of a more complex application.

Is the correct .Net framework installed on this computer? have you deployed any references?
SmashAndGrabAuthor Commented:
Andy - Is there a way of me finding out what the issue is?

Eric - I am currently in the process of creating a new simple project.

The 64 bit machine is a new build - not exactly sure what framework it will have  - probably whatever the latest one is.  
What do you mean about deploying references?  What do I need to do?
I normally just build the project - it then creates a setup.msi .

I then install the setup.msi on the machine.

This works perfectly well on 32 bit machines but when I install on a 64bit I get the above error.

of course, it may not be the fact that its a 64 bit - I'm guessing it could be anything.    

Hoping that someone can help?
AndyAinscowFreelance programmer / ConsultantCommented:
>>Andy - Is there a way of me finding out what the issue is?

This sounds rather like a run time error.  They aren't so easy to track down.  
I'd follow the advice from Eric first, if it is something you need to install then get that sorted out first.
Éric MoreauSenior .Net ConsultantCommented:
>>What do you mean about deploying references?

If you are using 3rd party controls/components, they need to be part of your .msi. Some, like Office, cannot be part of your .msi so it requires a separate installation.

Which OS have you installed? Which .Net framework is your project targeting?
SmashAndGrabAuthor Commented:
Hi Eric,

Thank you.

I have created a new simple blank application (testApp.exe) and it runs without issue on the 64 bit machine.

I'm not sure if its a fair test as the original app has a setup.

The OS i use is Windows 7 SP 1.  See screenshot:

32 bit OS
The 64 bit OS also Win 7 SP1. See Screenshot:

64 bit
this is the .Net framework on the 64 bit machine:

64 bit ..
AndyAinscowFreelance programmer / ConsultantCommented:
Have a look at your problem app and see what controls it uses.
Can you add one of each to this test app you now have and see if it still starts without problems.
Éric MoreauSenior .Net ConsultantCommented:
So because your test application ran without issues (no matter how it is deployed), the problem lies in one of the references. What do you have under the References of your project? Are they all in your deployment package? Have you tried to take the Bin folder (debug or release depending on you build your final application) and copy it as-is to the 64-bits system just as a test?
SmashAndGrabAuthor Commented:
Thank Eric -  Its this what you mean...

Screenshot from the SETUP project..
SmashAndGrabAuthor Commented:
Program Setup screen
SmashAndGrabAuthor Commented:
PreRequsites..
Éric MoreauSenior .Net ConsultantCommented:
Not the setup project. What are the references under your application's project?
SmashAndGrabAuthor Commented:
Apologies..

References from project
Éric MoreauSenior .Net ConsultantCommented:
I see SAP in your references (and I am not used to it). What are the requirements to deploy SAP?

Have you tried to take the Bin folder (debug or release depending on you build your final application) and copy it as-is to the 64-bits system just as a test?
SmashAndGrabAuthor Commented:
Hi Eric,

"Have you tried to take the Bin folder (debug or release depending on you build your final application) and copy it as-is to the 64-bits system just as a test? "

Can you explain what you mean here?  I can test it when I know what you mean. :)

Thanks

Stuart
Éric MoreauSenior .Net ConsultantCommented:
The result of the compilation is sent to the bin folder (debug or release). Copy the all the files in the same folder as your application .exe to the 64-bits computer (plain old copy - not install) and double the .exe from there. Is that working?
SmashAndGrabAuthor Commented:
Hi Eric,

This folder:

BIN FOLDER CONTENTS
It is currently copying to the 64 bit machine as we speak.  

Will post results shortly.

Thanks

Stuart
SmashAndGrabAuthor Commented:
Hi Eric,

1.  I copied the contents of the BIN folder on my local machine to the MCRS folder on the 64 bit machine (c:\Program Files (x86)\MCRS\).


I still get the same error (see screenshot)

Error from 64 bit folder
Éric MoreauSenior .Net ConsultantCommented:
probably (from what we can see from here) related to SAP. I would start by looking into this direction.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SmashAndGrabAuthor Commented:
I think I have found the issue.  Its to do with the database that this application is using.  

It uses an Access Database and uses ODBC drivers.
AndyAinscowFreelance programmer / ConsultantCommented:
>>It uses an Access Database and uses ODBC drivers.

Is the access a 32 bit or (hopefully not) a 64 bit version?  You could try changing to oledb drivers and see if that makes a difference.
You could make a small app that makes a connection to the DB, check that you can get that to run and then see if there is a difference in your settings between the two (test and real) apps.
SmashAndGrabAuthor Commented:
Good idea Andy - thanks.

Its 32 bit office.
What do you mean by changing the OLEDB drivers?


Will give the test a shot.
AndyAinscowFreelance programmer / ConsultantCommented:
>>What do you mean by changing the OLEDB drivers?

You say you currently use ODBC.  I'm saying try it with OLEDB (very different) as well just as an alternative to see if that makes a difference.
SmashAndGrabAuthor Commented:
I wished there was a way or giving you the application (its only 2mb) I bet you'd spot the problem in about 2 seconds! haha
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.