ni.com is currently experiencing issues.
Support teams are actively working on the resolution.
ni.com is currently experiencing issues.
Support teams are actively working on the resolution.
01-08-2021 02:09 PM
My Code:
private StimulusProfile ExecuteStimulusProfile()
{
Console.WriteLine("Checking for compile-time errors...");
StimulusProfile stimulusProfile = new StimulusProfile(m_stimulusProfileFilePath);\
}
where
stimulusProfile = "C:\\Users\\ngupta\\Documents\\VeriStand Projects\\Engine Demo\\Stimulus Profiles\\Basic Engine Demo\\Engine Demo Basics.nivsstimprof"
which is a valid path to the Stimulus Profile.
Error:
System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'NationalInstruments.VeriStand.StimulusProfileDefinitionApi.StimulusProfile' threw an exception.
Source=NationalInstruments.VeriStand.RealTimeSequenceDefinitionApi
StackTrace:
at NationalInstruments.VeriStand.StimulusProfileDefinitionApi.StimulusProfile..ctor(String file)
at AutoVeristand.VeristandExecution.ExecuteStimulusProfile() in C:\Users\ngupta\source\repos\AutoVeristand\AutoVeristand\VeristandExecution.cs:line 99
at AutoVeristand.VeristandExecution.Start() in C:\Users\ngupta\source\repos\AutoVeristand\AutoVeristand\VeristandExecution.cs:line 56
at AutoVeristand_TestApp.RunVeristand.Start(String[] args) in C:\Users\ngupta\source\repos\AutoVeristand\AutoVeristand_TestApp\RunVeristand.cs:line 46
at AutoVeristand_TestApp.Program.Main(String[] args) in C:\Users\ngupta\source\repos\AutoVeristand\AutoVeristand_TestApp\Program.cs:line 22
Inner Exception 1:
FileNotFoundException: Could not load file or assembly 'NationalInstruments.VeriStand.Internal, Version=2018.0.0.0, Culture=neutral, PublicKeyToken=a6d690c380daa308' or one of its dependencies. The system cannot find the file specified.
VeriStand Version on machine - 2020
Please help me resolve this?
I'm very new to Visual Studio, NI Veristand, C#
Thank you!
Solved! Go to Solution.
01-10-2021 03:52 PM
I'm not familiar with VeriStand but this part of the exception message stood out to me:
FileNotFoundException: Could not load file or assembly 'NationalInstruments.VeriStand.Internal, Version=2018.0.0.0, Culture=neutral, PublicKeyToken=a6d690c380daa308' or one of its dependencies. The system cannot find the file specified.
I assume that the file does exist on disk? It does seem odd that you mention Veristand 2020 but the assembly is referencing "2018.0.0.0" (implying its for Veristand 2018). Perhaps make sure you are referencing the latest version that you have on your PC (perhaps "2020.0.0.0") in your project references in Visual Studio.
01-11-2021 07:54 AM
Hi tyk007
I tried changing the version to 2020 but that is not working.
01-12-2021 01:10 AM
Indeed, the problem is in the assembly version - your code tries to load 2018 version. Correct assembly version for 2020 is "8.0.0.0" - NI changed the versioning scheme in Veristand 2019.
01-12-2021 02:00 AM
Hi,
Try to change the "specific version" to false in your project references for VeriStand so it resolves to the current registered assemblies.
Regards
01-12-2021 10:38 AM
I imported the latest dll from the Veristand 2020.
Which has resulted in the below errors:
I'm also attaching my .NET version details which I'm using to run my code.
Please help.
01-13-2021 01:17 AM
Hi,
Your Veristand.ClientApi has a 2018 version, maybe its a mismatch. Try remove the reference and set it back from the 2020 ClientApi.
Regards
02-26-2021 03:06 AM
Hi,
I have the same error and I am on Veristand 2018 SP1, the NationalInstruments.Veristand.ClientAPI file seems missing from disk. What is a possible solution for this? I cannot find any resources online to get the file back on disk. Do I have to reinstall? Would reinstalling affect any of my projects that I have currently?
Thanks.
03-11-2021 07:52 AM
Hi siddeshk,
Error 1: Exception thrown: 'System.TypeInitializationException' in AutoVeristand.dll
An unhandled exception of type 'System.TypeInitializationException' occurred in AutoVeristand.dll
The type initializer for 'NationalInstruments.VeriStand.StimulusProfileDefinitionApi.StimulusProfile' threw an exception.
Resolution Steps:
If the Veristand version is different that what is specified in the document, please follow the below steps:
Go to the below file path for the updated dll’s of the Veristand Version installed.
C:\Program Files (x86)\National Instruments\VeriStand 2020