creation of classlib of Information Models|OPC UA Companion Standards|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
creation of classlib of Information Models
Avatar
Stéphane Le liegard
New Member
Members
Forum Posts: 1
Member Since:
06/18/2019
sp_UserOfflineSmall Offline
1
09/16/2019 - 02:58
sp_Permalink sp_Print sp_EditHistory

Hi,

I am currently trying to create a class lib of the Information Model present on https://github.com/OPCFoundati…..UA-Nodeset.
But i can’t figure out if this is possible from the .cs files provided.

Here is the process with DI:

– dotnet new classlib && cp DI/*.cs LibDI/

– dotnet add reference <path/to/Opc.Ua.Core.csproj>

– dotnet build -> missing definitions of different class that are located in OPCFoundation/UA-Nodeset/Schema

– So i repeat the same process to create the LibSchema.

– dotnet build -> loooots of warning like (redirected all output to a log, got about 32000 lines), but still compile:

Le type ‘BaseConditionClassState’ dans ‘C:\Users\Hsioud\Documents\OPCUA\GSM-project\GSM\UA-InformationModels\SchemaLib\Opc.Ua.Classes.cs’ est en conflit avec le type import� ‘BaseConditionClassState’ dans ‘Opc.Ua.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’. Utilisation du type d�fini dans ‘C:\Users\Hsioud\Documents\OPCUA\GSM-project\GSM\UA-InformationModels\SchemaLib\Opc.Ua.Classes.cs’. [C:\Users\Hsioud\Documents\OPCUA\GSM-project\GSM\UA-InformationModels\SchemaLib\SchemaLib.csproj]

– then back to LibDI, dotnet add reference ../SchemaLib/

– dotnet build -> error:

error CS0433: Le type ‘InstrumentDiagnosticAlarmState’ existe dans ‘Opc.Ua.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ et ‘SchemaLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ [C:\Users\Hsioud\Documents\OPCUA\GSM-project\GSM\UA-InformationModels\LibDI\LibDI.csproj]

 Do you know how i could solve that ? Is there an easy way to create classlib of the *.cs files you provide in the NodeSet repo ?

I have to use only .NetCore

$ dotnet –version
 Version:   2.2.401

Avatar
Randy Armstrong
Admin
Forum Posts: 1578
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
09/16/2019 - 03:10
sp_Permalink sp_Print

I am not sure what you are trying to do and why you would want to. The files are already embedded resources in Opc.Ua.Core and can’t be added to a second project.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 29
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1444
Posts: 4887