03-30-2011 11:39 AM
I have recently upgraded to TestStand 2010 and Visual Studio 2010 from TestStand 4.2.1 and Visual Studio 2008. I am now getting the following error in the sequence analysis for all calls to my .net dlls.
"Module for Step 'My_StepType' not Loadable. Could not load file or assembly or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded."
I do not know what runtime it is referring to. It all worked previously. I have tried to browse to the dll again but that doesn't make any difference.
Solved! Go to Solution.
03-30-2011 11:58 AM
Hi, have you opened your VS 2008 project into VS 2010 so that it can perform the conversion by the conversion wizard?
03-30-2011 12:05 PM
Yes. I have rebuilt all libraries with VS 2010. We did target the .NET 4 framework instead of .NET 3.5 when switching to VS 2010.
03-30-2011 01:02 PM
Are you actually see a related error when you run your sequence in the Sequence Editor or UI rather than the analyse tool?
03-30-2011 01:27 PM - edited 03-30-2011 01:33 PM
By default the TestStand Sequence Editor targets .NET 2.0 and the .NET adapter can call assemblies built in .NET 2.0-3.5. This is because those versions of .NET all share the same CLR version. .NET 4.0 however moved to a new CLR, meaning that if you want to call .NET 4.0 assemblies you will need to make the Sequence Editor target .NET 4.0 as well. You can do this by creating an app config file for SeqEdit.exe.
Without going into too many details, just create a file named "SeqEdit.exe.config" and put the following text in it:
Then place this file in the same directory as SeqEdit.exe. I believe we have an article explaining this in more detail. I'll try and find it. Your other option is to target an earlier framework with your .NET assemblies (this is just a project setting in VS 2010).
03-30-2011 01:28 PM
Also note that my above explanation only applies to the Sequence Editor. If you are using a UI and you can rebuild it then you can just set your UI to target .NET 4.0 using the project settings in VS 2010.
03-30-2011 01:48 PM
I found where this topic is discussed in a bit more detail. It is in the TestStand Reference Manual that gets installed with TS. In TS 2010 it is on page 5-12 and is the section labeled Using the .NET Framework under the .NET Adapter section of Chapter 5 (Module Adapters).
03-30-2011 02:58 PM
Thanks for all the help. Creating the SeqEdit.exe.config file solved the problem. Though, I have to say that as a user it seems like this is something that should have been a configurable option in the station options. From a usability stand point NI fumbled on this one.
I'd be interested in knowing if there are any downsides to having TestStand load .NET CLR 4.0. The reference manual did not give any warnings so it seems like NI expects it to work okay.
03-31-2011 09:59 AM
TestStand 2010 supports using the .NET 4.0 CLR as documented. When using the 4.0 CLR like this, even 2.0 CLR assemblies will be loaded and run in the 4.0 CLR. 2.0 CLR assemblies should work fine in the 4.0 CLR in the vast majority of cases since Microsoft has tried to maintain backwards compatibility as much as possible. Let us know if you run into any issues.
Hope this helps,
05-24-2011 07:12 PM
It seens that this document
says calling .NET Framework 4.0 assemblies in TestStand 4.x is not supported.
TestStand 2010 is 4.x and the article specifically refers to Primary Software Version: 2010 SP1
So it looks like TestStand 2010 does not support .NET 4.0, right?