Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET program blew up

Solved!
Go to solution

Walter,

 

You need to click on the compile button (below application) then click on the advanced compile options.

 

Here you can set the tyarget framework and also set the Traget cpu to AnyCpu, x86 or x64.

 

Regards

 

steve 

 

 

Compile Options.jpg

0 Kudos
Message 11 of 40
(3,782 Views)

its in a different location in VB.

 

2009-12-15_114939.jpg

Richard S -- National Instruments -- (former) Applications Engineer -- Data Acquisition with TestStand
0 Kudos
Message 12 of 40
(3,780 Views)

Thanks Snowman. I found it and changed the target to 3.5. It still throws the warnings:

 

Warning    1    Referenced assembly 'C:\Program Files\National Instruments\
MeasurementStudioVS2008\DotNET\Assemblies\Current\
NationalInstruments.Common.Native.dll' targets a different processor than
the application.    Load Deflection Tester

same warnings (2 through 5) with:
NationalInstruments.DAQmx.dll
NationalInstruments.UI.Styles3D.dll
NationalInstruments.UI.WindowsForms.dll
NationalInstruments.UI.dll
 

If I click on any of these it shows 2008 version. Apparently I am no closer than I was a couple days ago.

 

Labview 8.5
Meas Studio 2008
0 Kudos
Message 13 of 40
(3,775 Views)
Solution
Accepted by walter-donovan

The warning you show below is about the Target Processor, not the Target Framework. I suspect that the Target CPU of your project is either x64 or Any CPU. Change it to x86 to resolve these warnings. You can see the Target CPU setting in the screenshot that Richard posted.

 

Versions of Measurement Studio prior to Measurement Studio 2009 (which just started shipping on December 4th) can be used only in 32-bit applications. Measurement Studio 2009 includes assemblies that can be used in 64-bit applications.

 

 

David Rohacek

National Instruments

Message 14 of 40
(3,754 Views)
A collective thank you to all who responded. I can now compile without error. I have learned a valuable lesson and will probably never upgrade anything ever again.
Labview 8.5
Meas Studio 2008
0 Kudos
Message 15 of 40
(3,750 Views)

Hi David,

 

I am having a similar problem. Using C# 2010 Express, I'm not sure how to change the target platform.  I've tried adding:

 

<PlatformTarget>x86</PlatformTarget>

 

in the project file of the XML editor, but I still have the "targets a different processor" warning comming up for both NationalInstruments.Common.Native.dll and NationalInstruments.DAQmx.dll.

 

The two errors I'm experiencing are 

 

"NationalInstruments.ISupportSynchornizationContext" is defined in an assembly that is not referenced. You must add a reference to assembly "NationalInstruments.Coommon, Version9.040.610" and something similar for NationalInstruments.IsyntchronizeCallbacks".  

 

I have tried referencing the .dll's from the Assemblies(64-bit) in the 9.0.40.610 directory and have also copied and pasted the files into the same directory as my code.  I've tried a similar approach with the files from the 9.3.40.219 and Current directories.

 

I'm still not sure what is wrong.

 

Any suggestions?  Any help is greatly appreciated.

 

Thanks 

0 Kudos
Message 16 of 40
(2,773 Views)

Hi Seth, 

 

Could you post the section of code that mentions the "NationalInstruments.ISupportSynchornizationContext" as well as the reference you made to "NationalInstruments.Coommon, Version9.040.610". It would be helpful to see this. 

 

Thanks!
Jackie

DAQ Product Marketing Engineer
National Instruments
0 Kudos
Message 17 of 40
(2,674 Views)

Hi Jackie,

 

Since I'm only doing a test code right now, here's the entire code:

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NationalInstruments;
using NationalInstruments.DAQmx;

namespace WindowsFormsApplication1
{
       public partial class Form1 : Form
       {
              public Form1()
              {
                     InitializeComponent();
              }

              private void WriteData_Click(object sender, EventArgs e)
              {
                     Task writeAO0Task = new Task();
              }
        }

 

 

At the moment, I'm just rying to set up a simple program that will compile and run that I could then build on. 

The references added in the solution explorer are NationalInstruments.Common.Native and NationalInstruments.DAQmx. 

 

 

Thanks,

 

Seth 

0 Kudos
Message 18 of 40
(2,668 Views)

Hi Seth, 

 

I would try adding a reference to NationalInstruments.Common. Add "using NationalInstruments.Common" To your code. Let me know how this turns out!

 

Regards,
Jackie

DAQ Product Marketing Engineer
National Instruments
0 Kudos
Message 19 of 40
(2,644 Views)

Hi Jackie,

 

Adding:

 

NationalInstruemnts.Common; 

 

to the set of using statements gives me the error:

 

The type or namepscae name 'Common' does not exist in the namespace 'NationalInstruments' (are you missing an assembly reference?) 

 

NationalInstruments.Common.Native is in the Solution Explorer.  Double clicking on it shows it in the Object Browser with the other References.

 

While typing the statement, it appears that I only have access to NationalInstruments.Restricted, or NationalInstruments.DAQmx.  So I'm not sure how tot perperly add the reference.

 

Thanks,

 

Nitin 

0 Kudos
Message 20 of 40
(2,640 Views)