Could not load type 'System.Runtime.InteropServices.FILETIME' |Classic OPC: DA, A&E, HDA, XML-DA, etc.|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Could not load type 'System.Runtime.InteropServices.FILETIME'
Avatar
Linnea Larsson
New Member
Members
Forum Posts: 2
Member Since:
12/02/2022
sp_UserOfflineSmall Offline
1
02/09/2023 - 06:52
sp_Permalink sp_Print

Hi,

I am trying to implement OPC services in our test framework and I am running in to this issue: 

System.TypeLoadException
HResult=0x80131522
Message=Could not load type 'System.Runtime.InteropServices.FILETIME' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Source=OpcNetApi.Com
StackTrace:
at OpcCom.Da.Interop.GetItemValues(IntPtr& pInput, Int32 count, Boolean deallocate)
at OpcCom.Da20.Subscription.Read(ItemValueResult[] items, Boolean cache)
at OpcCom.Da20.Subscription.Read(ItemIdentifier[] itemIDs, Item[] items)
at OpcCom.Da.Subscription.Read(Item[] items)
at Opc.Da.Subscription.Read(Item[] items)

I have installed the latest redistributables and opc .net rcw, but it still gives me this error. 

Avatar
Randy Armstrong
Admin
Forum Posts: 1451
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
02/09/2023 - 13:56
sp_Permalink sp_Print

Sounds like you are mixing .NET 4.0 and .NET 2.0 assemblies.

Do the sample clients build and run on your system?

Avatar
Linnea Larsson
New Member
Members
Forum Posts: 2
Member Since:
12/02/2022
sp_UserOfflineSmall Offline
3
02/10/2023 - 00:31
sp_Permalink sp_Print

Hi, 

Our project runs with .NET 6 and I have managed to do a Connect & Subscribe. I had some issues then, but when installing the redistributable for x64 it worked. But when trying to do a Read I ran in to this issue. 

The sample clients build and run without issues. 

 What assemblies should I be looking at? 

Avatar
Randy Armstrong
Admin
Forum Posts: 1451
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
02/10/2023 - 01:08
sp_Permalink sp_Print

I would upgrade the sample clients to .NET 6.0 and see if they still work.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online: Felipe Martin_1, Pablo Vázquez
Guest(s) 39
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1349
Posts: 4579