Page 1 of 1

Unsing SDK in Powershell Script

Posted: 09 Nov 2021, 08:22
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)

Re: Unsing SDK in Powershell Script

Posted: 12 Nov 2021, 12:04
by BrunW
Has nobody an if idea if and how we can realize this?

Best Regards

Re: Unsing SDK in Powershell Script

Posted: 15 Nov 2021, 12:47
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.