08-03-2017 09:35 AM
Hello All,
I’m trying to run CDotNetLoadAssembly, from TestStand , but it returns -6579 error code. The assembly file itself is in the same folder as sequence file and the whole project is.
After a debugging procedure, I found out that the actual path that TestStand was referring to, was different than the path of the sequence file and the assembly file.
I tried to register assembly path using CDotNetRegisterAssemblyPath but it didn’t solve the issue.
Then I moved my assembly file to the path that I found in debug process, rerun the sequence again, no error appeared. Also, I was able to invoke other functions from the assembly file.
How can I configure TestStand to refer to specific folder/library to complete the "CDotNetLoadAssembly" action successfully?
Best Regards,
Art
08-07-2017 08:39 AM
Is there any reason you're using the C/C++ adapter instead of the .NET adapter?
What you're describing is expected behavior for .NET -The assembly you're trying to load needs to be in one of these places:
See this document for more information:
MSDN: How the Runtime Locates Assemblies
-Trent
08-07-2017 08:55 AM
Hi Art,
When you use CDotNetRegisterAssemblyPath, what's the value of the status int that's returned? Also, what is the path that TestStand is expecting the assembly when you were debugging?
Justin
08-07-2017 09:14 AM
Hi Trent,
I'm using C/C++ adapter because I invoke a dll from CVI, that wraps .NET assembly. Once I move the assembly file to a path that TestStand "looking" at - ...\Public\Documents\... don't quite remember (currently not at the working station). Everything works fine. But I would like to remain in my project path.
Thanks for the support,
Art
08-07-2017 09:18 AM
Hi Justin,
CDotNetRegisterAssemblyPath was successful. I will double check it. Regarding the path that TestStand was looking at, it was somewhere in user\Documents\Public\.....
08-07-2017 10:29 AM - edited 08-07-2017 10:29 AM
CDotNetRegisterAssemblyPath will not help for this. If you do not want to move it from it's current location, you can specify it's location with the <codeBase> element in a config file. For this to work, the assembly must have a strong name if it's not in a subdirectory of the application.
I would strongly recommend reading through the MSDN link in my last post.
08-08-2017 02:13 AM
Thanks, I will definitely do so.