Unsing SDK in Powershell Script

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
BrunW
Jr. Member
Jr. Member
Posts: 2
Joined: 08 Nov 2021, 11:14

Unsing SDK in Powershell Script

Post by BrunW »

Hallo!

Is it possible to use .NET based OPC UA SDK in Powershell with LicenseManager.
If I call AddProcessLicenses I always get this error:
'The invoked member is not supported in a dynamic assembly'

Code: Select all

using namespace System.Collections.Generic
using namespace UnifiedAutomation.UaBase

$gApplicationLicenseManager = [UnifiedAutomation.UaBase.ApplicationLicenseManager]
$Path = $OpcUaPath + "\UnifiedAutomation\license.lic"
$Assembly = [System.Reflection.Assembly]
$ExecAssembly = $Assembly::GetExecutingAssembly()
$gApplicationLicenseManager::AddProcessLicenses($ExecAssembly, $Path)

BrunW
Jr. Member
Jr. Member
Posts: 2
Joined: 08 Nov 2021, 11:14

Re: Unsing SDK in Powershell Script

Post by BrunW »

Has nobody an if idea if and how we can realize this?

Best Regards

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Unsing SDK in Powershell Script

Post by Support Team »

Hi,

it is (and never was) the intention to make usable the .NET assemblies in Powershell (nor with any other scripting approach). The OPC UA .NET assemblies of Unified Automation are designed to create end-user-applications (executables) which have OPC UA client and/or server functionality being an integral part of such application.
Best regards
Unified Automation Support Team

Post Reply