Solved

C# "... is not a valid Win32 application"

Posted on 2014-12-03
13
211 Views
Last Modified: 2014-12-16
I am trying to run an Application created using VS 2010 on a Win 7 64bit system and get the above error.
At first I thought it must be the project not targeting "anyCPU" but this has proved not to be the case.
I have tried running other applications (created with VS) on the machine and get the same error.
Other applications (VIZ engine, VLC, etc all run fine on the machine.

Could a corrupt .Net installation cause the error to be generated?
0
Comment
Question by:jetbet
13 Comments
 
LVL 14

Expert Comment

by:brendanmeyer
ID: 40480014
What versions of .NET are installed?
Which Version of .NET is the project targeting?
0
 

Author Comment

by:jetbet
ID: 40480026
.NET 4.5.1
The applications starts on another machine (same specs etc) also with only 4.5.1 installed.
0
 
LVL 7

Expert Comment

by:Network Zero
ID: 40480045
Try recreating the application and try again. maybe it's corrupted on that computer and not the other one.
0
 

Author Comment

by:jetbet
ID: 40482087
I have upgrade my environment to VS 2013 and rebuilt the application. It still only works on the test machine with the same OS, dotNET, etc.

One clue is that dotNet applications that do not use a .dll seem to be fine on both machines.
0
 
LVL 11

Expert Comment

by:vo1d
ID: 40483671
do you use interop or pinvoke in your application?
Could you please check your Windows EventViewer for Runtime Failure entries?
0
 

Author Comment

by:jetbet
ID: 40483730
I have checked the event viewer but there is nothing to show the issue.

I do not believe I use pinvoke or interop.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:jetbet
ID: 40485964
After I transfer the files all the .dlls are missing the File Version, Product Name, Product Version, Copyright etc. values from the properties.
When I try and start the exe I get a “… is not a valid Win32 application” error and it will not start.
If I try and send the Zip file and extract it up there I get an error saying the zip file cannot be extracted because it is empty. This is the same zip file I used earlier to get the files I transferred, so originally it is fine.
If I unzip the files to the local test Viz preview machine, I have no problems and it starts fine.

I created a small Hello World application with a .dll and transferred these to the same machine, via the same VNC connection, and this started fine. The Version info etc. was also showing on this .dll.

I have even reinstalled the .Net Framework 4.5.1 on the target machine but this made no difference.
0
 
LVL 11

Expert Comment

by:vo1d
ID: 40487213
Could you please compile the whole solution as x86 and test it on the development and the  "problematic" machine?
0
 

Author Comment

by:jetbet
ID: 40487605
The solution is compiled by a 3rd party vendor.

Could you please advise what you believe the issue may be before I arrange this.
0
 

Accepted Solution

by:
jetbet earned 0 total points
ID: 40487937
I have copied the file to a shared folder and had someone copy this to a flashdrive. I have then unzipped the files from there to the correct folder and it works fine.
All Version info etc is also showing.

The issue is somehow related to the way the vendor compiles the code and the interaction between that and the RealVNC transfer.

I do know the vendor uses Obfuscation in some of his code and that may be the cause of the incorrect interaction.
0
 
LVL 11

Expert Comment

by:vo1d
ID: 40488163
so that version works fine on the "problematic" machine?
0
 

Author Comment

by:jetbet
ID: 40489402
Yes, it looks like it ws not the machine that was problematic but the transfer reaction with the files
0
 

Author Closing Comment

by:jetbet
ID: 40502229
The answer I came up with is the reason for the error. As to what caused the corruption I will not know at this stage.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now