Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Compile error LC : error LC0000: 'Could not load file or assembly

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_04-01_08-52-22.png

 

NickB

National Instruments

0 Kudos
Message 31 of 42
(3,449 Views)

Hey Nick,

I tried this also. Please suggest something else.

0 Kudos
Message 32 of 42
(3,447 Views)

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

0 Kudos
Message 33 of 42
(3,445 Views)

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.

 

0 Kudos
Message 34 of 42
(3,441 Views)

Got anything, Nick?

0 Kudos
Message 35 of 42
(3,431 Views)

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:

 

IF EXIST C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\ld​r64.exe C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\ld​r64.exe setwow
rem Begin Measurement Studio Licensing for x64
rem Do NOT modify contents between 'Begin Measurement Studio Licensing for x64' and 'End Measurement Studio Licensing for x64'
rem For more information, refer to Protecting Your Project from LC0000 Build Error (ms-help://MS.VSCC.v80/MS.VSIPCC.v80/NI.MeasurementStudio.2005/MStudioIntegration/XML/Protect_LC0000_Error.html) in the NI Measurement Studio Help.
if exist %WINDIR%\Microsoft.NET\Framework64\v2.0.50727\ %WINDIR%\Microsoft.NET\Framework64\v2.0.50727\ldr64.exe setwow
rem End Measurement Studio Licensing for x64

 

and you should add this to your post build:

 

IF EXIST C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\ld​r64.exe C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\ld​r64.exe set64
rem Begin Measurement Studio Licensing for x64
rem Do NOT modify contents between 'Begin Measurement Studio Licensing for x64' and 'End Measurement Studio Licensing for x64'
rem For more information, refer to Protecting Your Project from LC0000 Build Error (ms-help://MS.VSCC.v80/MS.VSIPCC.v80/NI.MeasurementStudio.2005/MStudioIntegration/XML/Protect_LC0000_Error.html) in the NI Measurement Studio Help.
if exist %WINDIR%\Microsoft.NET\Framework64\v2.0.50727\ %WINDIR%\Microsoft.NET\Framework64\v2.0.50727\ldr64.exe set64
rem End Measurement Studio Licensing for x64

 

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

0 Kudos
Message 36 of 42
(3,422 Views)

No..its also not helping. Please find attached snapshot of error getting after putting suggested Pre and Post Build.

0 Kudos
Message 37 of 42
(3,394 Views)

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

0 Kudos
Message 38 of 42
(3,387 Views)

That also I tried. But end up with same result.

0 Kudos
Message 39 of 42
(3,382 Views)

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?

0 Kudos
Message 40 of 42
(3,380 Views)