04-01-2011 08:55 AM
Hello -
Are you still getting the error "...An attempt was made to load a program with an incorrect format"? If so, it's likely because you're targeting the wrong platform. To resolve this, you need to open the project properties, select the "Build" tab, and ensure the platform target is set to x86.
NickB
National Instruments
04-01-2011 09:56 AM
Hey Nick,
I tried this also. Please suggest something else.
04-01-2011 10:06 AM
Hello -
Just to be clear, when developing with Measurement Studio libraries in VS2005 (especially on a 64-bit OS), you must set the Target Platform to x86. We need to start from there. Once you've done that, can you please post a screenshot of the error you get at runtime? Also, can you follow the instructions here to generate fusion logs for the execution of your program?
Thanks -
NickB
National Instruments
04-01-2011 10:39 AM
I tried x86 thing also. But I wanted to let you know that I am able to build the solution on WIndows 7- 32 Bit in one shot.
I tried the below thing on WIndows 7 64 Bit:
1. Created new C# Windows Application in Visual Studio 2005
2. Added a WaveformGraph control from Toolbox
3. Set the settings as shown in attached file.
4. Builded the Project
Hence throwing error shown in attached file.
04-01-2011 12:10 PM
Got anything, Nick?
04-01-2011 01:17 PM
I'm sorry - I've been in meetings and haven't been able to look at this until just now. I also made the mistake of assuming the error you were reporting was a run-time error and not a build time error.
I think the issue lies with your pre and post build steps. When I used what you posted, I got the same error as you. Instead of what you posted, you should add this to you pre build:
and you should add this to your post build:
Also - if you have installed Measurement Studio integration for Visual Studio 2005, you can do this automatically by selecting the menu item Measurement Studio»Add 64-Bit Protection to Project
Let me know if that resolves things -
NickB
National Instruments
04-04-2011 09:40 AM
No..its also not helping. Please find attached snapshot of error getting after putting suggested Pre and Post Build.
04-04-2011 10:06 AM
Code 3 is an indication that the path could not be found. Did you try adding 64-bit protection through the Measurement Studio menu item? I didn't stop to think that the path from my computer might differ from the path on your computer, but it's likely.
NickB
National Instruments
04-04-2011 10:28 AM
That also I tried. But end up with same result.
04-04-2011 11:06 AM
Hey Nick,
I tried to run the Visual Studio Solution as an Administrator and It worked for me. I am to build my solution successfully. Hence solved my issue. But I have one more question here is that If I created an EXE file and try to run as a Normal user, will it work? If not, then what needs to be done?