09-28-2012 02:26 PM
We have the Licensed version of National Instruments Measurement studio 8.0 for visual studio 2005.
We need to use it on the Windows 7 platform. It gets installed successfully, but during execution generates the exception which says:
Error 2 The command "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
" exited with code -1.
Kindly suggest the solution.
10-01-2012 11:22 AM
Can you confirm which version of Measurement Studio you are using? Measurement Studio 8.0 requires Visual Studio 2003, but 8.0.1 requires Visual Studio 2003 or 2005, which leads me to believe you are using Measurement Studio 8.0.1.
Please keep in mind that Measurement Studio 8.0 and 8.0.1 do not provide support for Windows 7. The supported operating systems are Microsoft Windows 2000/XP/XP x64. Therefore, we can not guarantee that Measurement Studio 8.0 or 8.0.1 will run on Windows 7.
Be sure that the Microsoft .NET Framework 2.0 is installed as well.
11-01-2012 10:56 AM
I ran across this thread and saw that the solution had not been posted. The error message actually points you to a help topic which I have posted below. Keep in mind that you will need to run Visual Studio as Administrator (right-click Visual Studio 2005 in the Start menu and select Run as Administrator from the context menu).
Protecting Your Project from LC0000 Build Error
The licensed Measurement Studio .NET libraries are not 64-bit-compatible; therefore, when lc.exe runs as a 64-bit application on a 64-bit Windows OS during Visual Studio 2005 project build time, the project fails to build because lc.exe is trying to instantiate the Measurement Studio types in 64-bit mode. This issue is a confirmed Microsoft bug. For more information, refer to Microsoft Knowledge Base article 913961 on the support.microsoft.com Web site.
This issue causes Visual Studio 2005 to display the following error:
LC: error LC0000: 'Could not load file or assembly file:///<installdir>\MeasurementStudioVS2005\DotNET\Assemblies\Current\NationalInstruments.UI.WindowsForms.dll or one of its dependencies. An attempt was made to load a program with an incorrect format.'
You can use Measurement Studio integrated tools to protect your project or you can manually protect your project from LC0000 build error.
|You must be logged in to Windows Vista as an Administrator to resolve LC0000 build error with Measurement Studio integrated tools or to resolve the build error manually.|
Measurement Studio integrated tools automatically protect your project from LC0000 build error in the following ways:
If you do not want Measurement Studio integrated tools to automatically update your project, you can disable the LC0000 error protection.
Complete the following steps to manually protect your project from LC0000 build error.
When a Visual Studio 2005 project with licensed components is built, Visual Studio runs an application called lc.exe (license compiler). When the license compiler runs at build time, the compiler reads the licenses.licx file included in the project, instantiates each type in the file, and then asks each type for its license. The resulting licenses are combined into a resource file by lc.exe. Then, Visual Studio takes this resource file of licenses and embeds it into the resulting application that is being built.
The license compiler application is a managed application, built against Microsoft .NET Framework 2.0 and built with the platform target set to any CPU, that executes inside the Common Language Runtime (CLR). Applications built against .NET Framework 2.0 and built with the platform target set to any CPU, run as 64-bit applications when executing on a 64-bit Windows OS and run as 32-bit applications when executing on a 32-bit Windows OS. The lc.exe application exhibits this dual behavior, which is problematic for .NET components that are not 64-bit-compatible.
07-02-2013 02:39 PM
I was getting this issue too. Granted, I should upgrade both my visual studios and measurement studios (still on 2010 and have 2013 cd sitting here), but the issue in Window 7 is that MS pretty much locked out program access to C:\ and C:\Windows\, so the command %windir%\Microsoft.NET\Framework64\v2.0.50727\ldr64.exe setwow doesn't work unless you run visual studios as admin. Not just logged into Windows with an system admin account, but also tell UAC to run Visual Studios as admin. That cleared it up without having to change any of the build commands or target CPU.
10-28-2015 07:17 PM
I have the same problem. But when I run Visual Studio as Administrator, this error disappear.