NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET Error with FrontEndCallBacks

Hello,

I am having a .NET error with front end callback execution using the TS API. This occurs on a freshly installed machine. By freshly installed I mean that I have an OS image which contains TestStand installation. I am working on a product that during startup invokes the frontendcallbacks using the API call:

CallFrontEndCallbackEx(FrontEndCallbacks.FrontEndCback_LoginLogout, null, TypeConflictHandlerTypes.ConflictHandler_Error, 0);

The user front end callback sequence (which is installed under C:\Program Files\National Instruments\TestStand 3.5\Components\User\Callbacks\FrontEnd) calls some APIs in a .NET dll that is located in the same location.

On the fresh installation, when I run this product that I am working on for the very FIRST time and it calls the API CallFrontEndCallbackEx, the execution fails with the following error:

"The .NET support dll could not be loaded. This is caused by an assembly path that could not be resolved!". After some trial and error I know for a fact that the error occurs when it tries to access the .NET dll located in the same location as the front end callback sequence. The funny thing is this occurs only the first time. If I close software and restart it, this call will succeed! (If I reimage the machine, bring it back to a clean state and run the software again for the 1st time, the problem will occur again).

Thanks in advance,
Harsha
0 Kudos
Message 1 of 6
(3,700 Views)
I would like to add another note:

 I don't get this error, when I invoke the TestStand sequence editor instead of my software. Definitely and issue with the way I am using the API.

Also I am using Version 2.0 of .NET framework.

Thanks,
Harsha
0 Kudos
Message 2 of 6
(3,687 Views)
Hi Harsha,

Are you registering your assembly in the Global Assembly Cache before running your software?  If not, try to register the assembly first.  Here is a link to Microsoft's website on registering an assembly.

Register Assembly
0 Kudos
Message 3 of 6
(3,675 Views)
Terry,

I tried registering, but it did not help. I wonder in what situations can TestStand (API) not load a .NET assembly? Is there some issue in the front end callbacks related to this?

Thanks,
Harsha
0 Kudos
Message 4 of 6
(3,647 Views)
Hi Harsha,

Is the assembly listed in the following directory?

C:\WINDOWS\assembly
0 Kudos
Message 5 of 6
(3,632 Views)
Terry,

Yes, after registering in the GAC the assembly is present in the winnt\assembly directory. But that did not help.

Thanks,
Harsha
0 Kudos
Message 6 of 6
(3,612 Views)