NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

error message when adding .NET action steps


TestStand deployment or development system, no .net steps:           No SDK or framework required.
TestStand deployment, with .net steps:                                               Framework required, SDK not needed.
TestStand development system, with .net steps:                              Framework and SDK required.
 
Is this correct?


I think that in your scenario, this is NOT correct. The only time you should need the SDK is if you are actually developing .NET code modules. The SDK is required to build the code modules. TestStand itself simply calls the code modules, which requires only the Runtime.


If I make a sequence that calls .net steps and give this sequence to other developers, what pre-requisites are there for running my sequence on another devlopment system?  In this case, the sequence needs to be executed, but the .net steps do not need to be edited.


The prerequisites depend on the code in the .NET code modules. At a minimum, they will require the .NET Runtime. You would need to ask the .NET code module developers if their code has any other dependencies that require you to install any other software to call into them. For example, if the .NET code modules are calling the National Instruments DAQmx .NET API, then you would need the DAQmx .NET libraries. As another example, it is conceivable that the .NET code modules are implemented in such a way that they require the SDK be installed on the system that calls into them. However, I would consider this to be a mistake in .NET code module implementation.

In an earlier post, you mentioned that you are editing the .NET steps. I assume that this means that you are configuring parameter values in TestStand and not editing the .NET source code itself. If this assumption is incorrect, then you will need the SDK (at a minimum).

0 Kudos
Message 11 of 22
(2,835 Views)
Yes, I think that's clear.  I have now installed the SDK, and I can select the Specify Module option OK now, instead of getting an error message.
 
We'll assume that the SDK isn't needed on either the deployments or the other TestStand development systems that run my sequence.
 
This does make sense.
 
Ta muchly.
0 Kudos
Message 12 of 22
(2,825 Views)

The better solution to this issue is as following, assuming that Visual Studio 2005 is used for developing the .NET assembly which is called by TestStand steps using .NET  adaptor:

1) On develop machine, in the solution where you have your project to build class library (.NET assembly), add a Setup project, make the class library project the "project output" of the Setup project, add file mscorcfg.dll which should exit on develop machine, e.g., C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\mscorcfg.dll to setup project as well. Set the Folder property of both items to Global Assembly Cache Folder. You will see Microsoft .NET Framework is listed as Detected Dependencies of this project.

2) Build Setup project yields a .msi file, e.g., MyAssembly.msi.

3) Deploy MyAssembly.msi to the machine where this assemply is to be used.

4) Run MyAssembly.msi. If .NET framework 2.0 is not installed on that machine, it will open a dialog telling you to download it first.

5) After .NET framework is downloaded, run MyAssembly.msi again, both MyAssembly.dll and mscorcfg.dll will be registered in global assembly cache.

Now you are ready to run TestStand sequence editor to create a step using .NET adaptor and specify module for this step, creating a class object in the assembly, calling a method of the class, etc. There is no need to install .NET framework SDK on a machine that just uses the .NET assembly.

Message 13 of 22
(2,711 Views)

Thanks very much for that further info.  I'll pass that on to our resident .net boffin.

-Sean.

0 Kudos
Message 14 of 22
(2,693 Views)
For .NET 2.0 this "mscorcfg.dll" is in SDK directory (Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin).
 
Copy this dll from a computer that has it along with the "gacutil.exe" tool (in the same directory) to a removable storage,
go the target machine, open DOS command window,
go the the removeable storage's appropriate folder (by typing 'cd <folder name>'),
type 'gacutil /i mscorcfg.dll'.
 
Now the dll is installed on that machine, and the error message mentioned in the first post will disappear.

 

S. Eren BALCI
IMESTEK
0 Kudos
Message 15 of 22
(2,578 Views)
National Instruments does not recommend the approach described in the above post. Under some circumstances, using the approach described in the above post could cause you to violate Microsoft's End User License Agreement for deploying the .NET Framework.
 
"mscorcfg.dll" is part of the .NET Framework runtime. It exists in the SDK directory to give you a place, outside of the GAC, to reference it in your projects (at build time).
 
Refer to this MSDN topic - http://msdn2.microsoft.com/en-us/library/xak0tsbd(VS.80).aspx - for information on Microsoft's recommended approach for deploying the .NET Framework.
 
David Rohacek
National Instruments

Message Edited by drohacek on 05-11-2007 06:32 AM

0 Kudos
Message 16 of 22
(2,571 Views)
I am recieving a similar error, though the body of my error dialog is "Object reference not set to an instance of an object.". I have tried all of the suggestions in this thread though the original poster's problem didn't directly match mine.

I have also tried running the examples provided by NI which all work correctly.

My .NET assemblies appear to work perfectly fine when referenced from simple console applications (also written in C#/VS2005). However, when I successfully build them and reference them from with TS via the .NET adapter, I get the dreaded:

".NET Error"
"Error while accessing the .NET assembly."
"Object reference not set to an instance of an object".

The real kicker here is that my calls to the assemblies all function correctly! Data is passed around, I can even debug the DLLs and trace code execution. Basically, if the dialog was not present, I would have no incling there was even a problem.

I am not necessarily looking for a solution, but rather some help in tracking down the root. I have tried reinstalling the various software applications numerous times, but to no avail.

Thanks!
0 Kudos
Message 17 of 22
(2,178 Views)

*bump* Compiling a simple test Assembly in VS2005 and referencing the produced DLL from TS 3.1 does not produce this problem. This leads me to believe there is *something* going on with how my other project has been defined. However, I have exhausted my limited knowledge on this subject and would appreciate some external insight into the problem...

Thanks

0 Kudos
Message 18 of 22
(2,158 Views)
Some more digging: The assembly that is experiencing this problem is part of a solution with multiple assemblies. Each assembly in the solution has a dependence on one single 'central' assembly in the solution. I can successfully load this 'central' assembly into TS without a problem. I can access all of the members and properties as well. However, it is the assemblies that reference this 'central' assembly in the solution which experience the problem outlined in my previous posts.

On a whim, I tried recreating this scenario with stubs classes -- i.e. a solution with multiple assemblies with a dependence on a central assembly within the solution. Sadly, I could not recreate the problem, that is to say there was no issue accessing any properties or methods from any of the assemblies in the stub solution.
0 Kudos
Message 19 of 22
(2,142 Views)
Hi gee_bee,

Do you have any watch expressions?  Since you said your steps still call your assemblies correctly I'm wondering if maybe there is a watch expression that is referencing something that is invalid which is causing this dialog.  You can find your watch expressions by putting a breakpoint in your sequence file and running it. 

That was just the first thing I thought of that may be causing this problem.  Let me know if that's not the cause and we can keep thinking of what it could be.
Kristen
National Instruments
0 Kudos
Message 20 of 22
(2,119 Views)