Skip to content
Merged
Show file tree
Hide file tree
Changes from 125 commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
7df108c
make types project aot compatible
marcschier Mar 18, 2026
a9e15ce
newtonsoft
marcschier Mar 19, 2026
c27d8c9
Migrate all projects from Mono.Options to System.CommandLine 2.0.5
marcschier Mar 19, 2026
4b54f8e
newtonsoft
marcschier Mar 19, 2026
7078b63
Updates
marcschier Mar 19, 2026
4fd14a2
Merge with master
marcschier Mar 20, 2026
b87ec1f
Merge branch 'master' into analyzerfixes2
marcschier Mar 20, 2026
621224f
Remove unconditional suppressions
marcschier Mar 20, 2026
6850614
Fix array clone
marcschier Mar 20, 2026
ea6f07d
Replace serializer for store
marcschier Mar 20, 2026
c0aa5ab
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Mar 20, 2026
c1f04ac
Updates
marcschier Mar 20, 2026
a948d00
Update
marcschier Mar 20, 2026
cd485ad
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Mar 20, 2026
4da6882
Update
marcschier Mar 20, 2026
38b05f9
Update
marcschier Mar 20, 2026
b9f8829
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Mar 20, 2026
ea41241
Update
marcschier Mar 20, 2026
f6969db
Update
marcschier Mar 20, 2026
2d3916e
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Mar 20, 2026
1b30e5d
Refactor status message assertions in tests
marcschier Mar 21, 2026
a041c25
Merge branch 'master' of https://github.com/OPCFoundation/UA-.NETStan…
marcschier Mar 27, 2026
89e807f
Updates
marcschier Mar 27, 2026
b0f5ba5
Merge branch 'master' of https://github.com/OPCFoundation/UA-.NETStan…
marcschier Mar 27, 2026
74a2452
More serializer
marcschier Mar 27, 2026
8726a9a
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Mar 27, 2026
a84be15
update
marcschier Mar 27, 2026
05fb8ef
Update
marcschier Mar 27, 2026
c08cfba
Update
marcschier Mar 27, 2026
fad48ec
Update
marcschier Mar 28, 2026
aa1b53a
update
marcschier Mar 28, 2026
ccff79e
Tests
marcschier Mar 28, 2026
23140ec
Add 22 new AOT integration tests covering 7 functional areas
marcschier Mar 28, 2026
55e6d5b
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Mar 28, 2026
4029d0f
gds
marcschier Mar 28, 2026
27bac55
gds
marcschier Mar 28, 2026
bbf45d8
serializer
marcschier Mar 28, 2026
e1c3f49
Update
marcschier Mar 28, 2026
21b77c4
Fix GDS test failures and CA1859 warning after serializer migration
marcschier Mar 29, 2026
5326183
types
marcschier Mar 30, 2026
694a11c
D3: Remove stale AOT suppressions; add AOT-safe AddExtension<T> overload
marcschier Mar 30, 2026
744ac0d
Remove all #region/#endregion directives from C# source files
marcschier Mar 30, 2026
a968f85
Updates
marcschier Mar 30, 2026
6839201
Rename Opc.Ua.Client.AotTests to Opc.Ua.Aot.Tests; add Async suffix t…
marcschier Mar 30, 2026
453d4b0
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Mar 30, 2026
6ef1aae
Merge
marcschier Mar 30, 2026
41bb777
Update
marcschier Mar 30, 2026
2668422
Update
marcschier Mar 30, 2026
0644de5
update
marcschier Mar 30, 2026
2293557
Update
marcschier Mar 30, 2026
239fe34
Update
marcschier Mar 31, 2026
fcc94d9
Fix NativeAOT test failures in Opc.Ua.Aot.Tests
marcschier Mar 31, 2026
5ed7d5f
Add NativeAOT test job to GitHub Actions CI workflow
marcschier Mar 31, 2026
7ebf357
Update
marcschier Mar 31, 2026
05268b8
Merge
marcschier Mar 31, 2026
70cfbf7
Implement [DataType] source generator for IEncodeable code generation
marcschier Mar 31, 2026
62cff38
Add unit tests for DataTypeSourceGenerator (10 tests)
marcschier Mar 31, 2026
a5c1fdd
Refactor [DataType] source generator to use template system
marcschier Mar 31, 2026
d6beec6
Update
marcschier Mar 31, 2026
d6364f1
Batch [DataType] source generation into single file per namespace
marcschier Mar 31, 2026
7c01f69
Cleanup
marcschier Mar 31, 2026
63e4f9b
Add [DataType] source generator compilation tests
marcschier Mar 31, 2026
a98d1ba
Add incremental compilation test for [DataType] source generator
marcschier Mar 31, 2026
f52dcc5
Tests
marcschier Mar 31, 2026
ddd712b
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Mar 31, 2026
e307314
Pilot: migrate GlobalDiscoveryServerConfiguration to [DataType] sourc…
marcschier Mar 31, 2026
4af428a
Re-enable GDS AOT tests — all 56 tests pass under NativeAOT
marcschier Mar 31, 2026
8fe4c8f
Update
marcschier Mar 31, 2026
c3f1579
Add inheritance/sealed/access model fields for [DataType] generator
marcschier Mar 31, 2026
cdd892d
Add inheritance/sealed/access support to [DataType] source generator
marcschier Mar 31, 2026
14d609b
Update
marcschier Apr 1, 2026
e478374
Add sealed/derived record templates and remove DerivedSealed
marcschier Apr 1, 2026
4f11aee
update
marcschier Apr 1, 2026
0b90bd3
Remove DataContractSerializer from GDS configuration types
marcschier Apr 1, 2026
0b1df96
Stream 4: Migrate BrowserOptions to [DataType] source generator
marcschier Apr 1, 2026
3515a86
Stream 3: Migrate OAuth2 types to [DataType] source generator
marcschier Apr 1, 2026
b931bcb
Stream 1: Annotate 16 AppConfig types with [DataType] source generator
marcschier Apr 1, 2026
53e27ca
Three generator improvements for Stream 1 completion
marcschier Apr 1, 2026
1f90723
Annotate remaining 4 AppConfig types with [DataType]
marcschier Apr 1, 2026
2562062
update
marcschier Apr 1, 2026
9089fe0
Update
marcschier Apr 1, 2026
6436d85
d7: Remove stale DCS suppressions from GDS server
marcschier Apr 1, 2026
4f2575d
s1-switch-load: Switch SaveToFile to IEncodeable.Encode
marcschier Apr 1, 2026
b5fbb92
update
marcschier Apr 2, 2026
444e4d4
partial
marcschier Apr 2, 2026
3cd43be
Fix
marcschier Apr 2, 2026
fc3fabc
s1-delete-file: Delete ApplicationConfigurationEncoding.cs (1738 lines)
marcschier Apr 2, 2026
654b71d
update
marcschier Apr 2, 2026
bafdfa7
update
marcschier Apr 2, 2026
8c5fd20
Fix ReadEncodeable to return null for absent fields + null guards
marcschier Apr 7, 2026
c5efc79
Fix all test failures: restore encoding file for load path
marcschier Apr 7, 2026
ea42ccb
Replace DataContractSerializer with XmlParser/XmlEncoder for SecuredA…
marcschier Apr 7, 2026
a58d1af
Update
marcschier Apr 7, 2026
02945c0
Update
marcschier Apr 7, 2026
bcf855e
Fix SaveToFile and ArrayOf<T> migration issues in ApplicationConfigur…
marcschier Apr 7, 2026
973f678
update
marcschier Apr 8, 2026
f784fdc
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Apr 8, 2026
f5783f9
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Apr 8, 2026
5588b7b
update
marcschier Apr 8, 2026
b1022c0
update
marcschier Apr 8, 2026
019d7d9
update
marcschier Apr 8, 2026
b46e04b
Update
marcschier Apr 8, 2026
089df8a
Update
marcschier Apr 8, 2026
b8d6f14
Update
marcschier Apr 8, 2026
05efa1f
Update
marcschier Apr 8, 2026
8f20a16
Update
marcschier Apr 8, 2026
2dd99c6
Update
marcschier Apr 8, 2026
af7ed2d
Update
marcschier Apr 8, 2026
467e260
update
marcschier Apr 8, 2026
76a0acf
Merge branch 'complextypes' of https://github.com/OPCFoundation/UA-.N…
marcschier Apr 8, 2026
b20bc76
Update
marcschier Apr 9, 2026
0018c69
Update
marcschier Apr 9, 2026
2e4507e
cleanup
marcschier Apr 9, 2026
f4ac5e6
remove
marcschier Apr 9, 2026
59c1a2b
devops
marcschier Apr 9, 2026
e9c6cec
Thread CancellationToken through CreateAddressSpace to OnAfterCreate
marcschier Apr 9, 2026
78f1c9b
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Apr 9, 2026
a73c75b
More data contract cleanup
marcschier Apr 9, 2026
c62ee12
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Apr 9, 2026
a1731f3
Modernize ApplicationInstance for hosted service patterns
marcschier Apr 9, 2026
94b61fb
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Apr 9, 2026
b63084b
Update
marcschier Apr 9, 2026
96b716c
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Apr 9, 2026
05e981c
update
marcschier Apr 9, 2026
7ef101d
Fix build
marcschier Apr 9, 2026
773bfb0
Update
marcschier Apr 9, 2026
9a2db70
Add config tests
marcschier Apr 9, 2026
a3eef7f
docs
marcschier Apr 10, 2026
8b6b920
update
marcschier Apr 10, 2026
55ac216
EmitDefault
marcschier Apr 10, 2026
c65492d
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Apr 10, 2026
fac3d50
Update
marcschier Apr 10, 2026
5a63ac7
Update
marcschier Apr 10, 2026
cb4ed0e
Update
marcschier Apr 10, 2026
d8b17e3
update
marcschier Apr 10, 2026
c2bc492
Update
marcschier Apr 10, 2026
29bf782
Merge branch 'analyzerfixes2' of https://github.com/OPCFoundation/UA-…
marcschier Apr 10, 2026
c6e222a
fix
marcschier Apr 10, 2026
e4f7cd1
PR feedback
marcschier Apr 13, 2026
a78bcb8
Fixes
marcschier Apr 13, 2026
f8bf978
Another fix
marcschier Apr 13, 2026
d6c4ffc
More
marcschier Apr 13, 2026
2766311
update
marcschier Apr 13, 2026
1d103d2
Move encodeable factory types to opc.ua.types
marcschier Apr 13, 2026
57896bf
Revert
marcschier Apr 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 9 additions & 4 deletions .azurepipelines/get-matrix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
.PARAMETER FileName
File patterns to match defining the folders and files in the matrix

.PARAMETER ExcludeFileName
Optional file pattern to exclude from the matrix

.PARAMETER JobPrefix
Optional name prefix for each job

Expand All @@ -25,6 +28,7 @@
Param(
[string] $BuildRoot = $null,
[string] $FileName = $null,
[string] $ExcludeFileName = $null,
[string] $JobPrefix = "",
[hashtable] $AgentTable = $null
)
Expand Down Expand Up @@ -57,6 +61,7 @@ $jobMatrix = @{}
# Traverse from build root and find all files to create job matrix
Get-ChildItem $BuildRoot -Recurse `
| Where-Object Name -like $FileName `
| Where-Object { [string]::IsNullOrEmpty($ExcludeFileName) -or $_.Name -notlike $ExcludeFileName } `
| ForEach-Object {

$fullFolder = $_.DirectoryName.Replace("\", "/")
Expand All @@ -76,11 +81,11 @@ Get-ChildItem $BuildRoot -Recurse `
}
$agents.keys | ForEach-Object {
$jobName = "$($JobPrefix)$($postFix)$($_)"
$jobMatrix.Add($jobName, @{
$jobMatrix.Add($jobName, @{
"poolImage" = $agents.Item($_)
"folder" = $folder
"fullFolder" = $fullFolder
"file" = $file
"folder" = $folder
"fullFolder" = $fullFolder
"file" = $file
"agent" = $($_)
})
}
Expand Down
2 changes: 1 addition & 1 deletion .azurepipelines/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
displayName: Pack Nuget ${{parameters.config}}
inputs:
command: pack
packagesToPack: 'UA Core Library.slnx'
packagesToPack: 'UA Core Library.slnx'
configuration: ${{parameters.config}}
configurationToPack: ${{parameters.config}}
nobuild: true
Expand Down
76 changes: 76 additions & 0 deletions .azurepipelines/test-aot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#
# Test Opc.Ua.Aot.Tests with native AOT publish using Microsoft Testing Platform
#
parameters:
configuration: 'Release'
agents: '@{}'
jobnamesuffix: ''
jobs:
- job: testaotprep${{ parameters.jobnamesuffix }}
displayName: Prepare AoT Test Jobs ${{ parameters.configuration }}
pool:
vmImage: 'windows-2025-vs2026'
variables:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
steps:
- task: PowerShell@2
name: aotmatrix
displayName: Prepare AoT Tests
inputs:
targetType: filePath
filePath: ./.azurepipelines/get-matrix.ps1
arguments: -FileName Opc.Ua.Aot.Tests.csproj -AgentTable ${{ parameters.agents }}
- job: testaot${{ parameters.jobnamesuffix }}
displayName: AoT Tests
dependsOn: testaotprep${{ parameters.jobnamesuffix }}
timeoutInMinutes: 30
strategy:
matrix: $[dependencies.testaotprep${{ parameters.jobnamesuffix }}.outputs['aotmatrix.jobMatrix'] ]
variables:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
pool:
vmImage: $(poolImage)
steps:
- task: UseDotNet@2
displayName: 'Install .NET 10.0'
inputs:
packageType: 'sdk'
version: '10.0.x'
- task: NuGetToolInstaller@1
inputs:
versionSpec: '>=7.0.x'
- task: PowerShell@2
displayName: Versioning
inputs:
targetType: filePath
filePath: ./.azurepipelines/set-version.ps1
- task: DotNetCoreCLI@2
displayName: Publish AoT Tests ${{ parameters.configuration }}
inputs:
command: publish
publishWebProjects: false
projects: $(file)
arguments: '--configuration ${{ parameters.configuration }}'
zipAfterPublish: false
modifyOutputPath: false
- task: PowerShell@2
displayName: Run AoT Tests
inputs:
pwsh: true
targetType: inline
script: |
$publishDir = Get-ChildItem -Path "$(folder)/bin/${{ parameters.configuration }}/net10.0/*/publish" -Directory | Select-Object -First 1
if (-not $publishDir) {
Write-Error "No publish directory found."
exit 1
}
if ($IsWindows) {
$exe = Join-Path $publishDir.FullName "Opc.Ua.Aot.Tests.exe"
} else {
$exe = Join-Path $publishDir.FullName "Opc.Ua.Aot.Tests"
}
Write-Host "Running: $exe"
& $exe
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
14 changes: 1 addition & 13 deletions .azurepipelines/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
inputs:
targetType: filePath
filePath: ./.azurepipelines/get-matrix.ps1
arguments: -FileName *.Tests.csproj -AgentTable ${{ parameters.agents }}
arguments: -FileName *.Tests.csproj -ExcludeFileName Opc.Ua.Aot.Tests.csproj -AgentTable ${{ parameters.agents }}
- job: testall${{ parameters.jobnamesuffix }}
displayName: Tests (${{ parameters.framework }})
dependsOn: testprep${{ parameters.jobnamesuffix }}
Expand All @@ -40,18 +40,6 @@ jobs:
pool:
vmImage: $(poolImage)
steps:
- task: UseDotNet@2
displayName: 'Install .NET 8.0'
condition: eq('${{parameters.framework}}', 'net8.0')
inputs:
packageType: 'sdk'
version: '8.0.x'
- task: UseDotNet@2
displayName: 'Install .NET 9.0'
condition: eq('${{parameters.framework}}', 'net9.0')
inputs:
packageType: 'sdk'
version: '9.0.x'
- task: UseDotNet@2
displayName: 'Install .NET 10.0'
inputs:
Expand Down
10 changes: 3 additions & 7 deletions .azurepipelines/testcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ jobs:
pool:
vmImage: ${{ parameters.poolImage }}
steps:
- task: UseDotNet@2
displayName: 'Install .NET 8.0'
condition: eq('${{parameters.framework}}', 'net8.0')
inputs:
packageType: 'sdk'
version: '8.0.x'
- task: UseDotNet@2
displayName: 'Install .NET 10.0'
inputs:
Expand Down Expand Up @@ -67,7 +61,9 @@ jobs:
timeoutInMinutes: 60
inputs:
command: test
projects: 'UA.slnx'
projects: |
**/*.Tests.csproj
!**/Opc.Ua.Aot.Tests.csproj
# note: /p:CollectCoverage=true is only used to disable deterministic builds
arguments: '--no-restore ${{ variables.DotCliCommandline }} --configuration ${{ parameters.configuration }} /p:CollectCoverage=true --collect:"XPlat Code Coverage" --settings ./Tests/coverlet.runsettings.xml --results-directory $(Agent.TempDirectory)'
publishTestResults: false
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/buildandtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,49 @@ jobs:
verbose: true
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}

aot-test:
name: aot-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
include:
- dotnet-version: '10.0.x'
configuration: 'Release'

env:
AOTPROJECT: './Tests/Opc.Ua.Aot.Tests/Opc.Ua.Aot.Tests.csproj'

steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Set Cloud Version
shell: pwsh
run: ./.azurepipelines/set-version.ps1

- name: Publish NativeAOT
run: dotnet publish ${{ env.AOTPROJECT }} --configuration ${{ matrix.configuration }}

- name: Run NativeAOT Tests (Linux)
if: runner.os == 'Linux'
run: ./Tests/Opc.Ua.Aot.Tests/bin/${{ matrix.configuration }}/net10.0/linux-x64/publish/Opc.Ua.Aot.Tests

- name: Run NativeAOT Tests (Windows)
if: runner.os == 'Windows'
run: ./Tests/Opc.Ua.Aot.Tests/bin/${{ matrix.configuration }}/net10.0/win-x64/publish/Opc.Ua.Aot.Tests.exe

- name: Upload test results
uses: actions/upload-artifact@v7
with:
name: aot-results-${{ matrix.os }}
path: '**/TestResults/**'
if: ${{ always() }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ BundleArtifacts/

# Others
ClientBin/
_publish/
~$*
*~
*.dbmdl
Expand Down
44 changes: 24 additions & 20 deletions Applications/ConsoleReferenceClient/ClientSamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Xml;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Opc.Ua;
using Opc.Ua.Client;
using Opc.Ua.Client.ComplexTypes;
Expand Down Expand Up @@ -1101,29 +1101,26 @@ ArrayOf<BrowseDescription> browseDescriptionCollection
/// Outputs elapsed time information for perf testing and lists all
/// types that were successfully added to the session encodeable type factory.
/// </remarks>
public async Task<ComplexTypeSystem> LoadTypeSystemAsync(
ISession session,
CancellationToken ct = default)
public async Task LoadTypeSystemAsync(ComplexTypeSystem complexTypeSystem, CancellationToken ct = default)
{
m_logger.LogInformation("Load the server type system.");

var stopWatch = new Stopwatch();
stopWatch.Start();

var complexTypeSystem = new ComplexTypeSystem(session, m_telemetry);
await complexTypeSystem.LoadAsync(throwOnError: true, ct: ct).ConfigureAwait(false);

stopWatch.Stop();

m_logger.LogInformation(
"Loaded {Count} types took {Duration}ms.",
complexTypeSystem.GetDefinedTypes().Length,
complexTypeSystem.GetDefinedTypes().Count,
stopWatch.ElapsedMilliseconds);

if (m_verbose)
{
m_logger.LogInformation("Custom types defined for this session:");
foreach (Type type in complexTypeSystem.GetDefinedTypes())
foreach (XmlQualifiedName type in complexTypeSystem.GetDefinedTypes())
{
m_logger.LogInformation("{Namespace}.{TypeName}", type.Namespace, type.Name);
}
Expand All @@ -1140,8 +1137,6 @@ public async Task<ComplexTypeSystem> LoadTypeSystemAsync(
}
}
}

return complexTypeSystem;
}

/// <summary>
Expand Down Expand Up @@ -1369,25 +1364,26 @@ public static string FormatValueAsJson(
}

// prettify
using var stringWriter = new StringWriter();
try
{
using var stringReader = new StringReader(textbuffer);
var jsonReader = new JsonTextReader(stringReader);
var jsonWriter = new JsonTextWriter(stringWriter)
using var doc = System.Text.Json.JsonDocument.Parse(textbuffer);
using var stream = new MemoryStream();
using (var writer = new System.Text.Json.Utf8JsonWriter(stream, new System.Text.Json.JsonWriterOptions
{
Formatting = Formatting.Indented,
Culture = CultureInfo.InvariantCulture
};
jsonWriter.WriteToken(jsonReader);
Indented = true
}))
{
doc.WriteTo(writer);
}
return Encoding.UTF8.GetString(stream.ToArray());
}
catch (Exception ex)
{
using var stringWriter = new StringWriter();
Comment thread
marcschier marked this conversation as resolved.
Outdated
stringWriter.WriteLine("Failed to format the JSON output: {0}", ex.Message);
stringWriter.WriteLine(textbuffer);
throw;
}
return stringWriter.ToString();
}

/// <summary>
Expand Down Expand Up @@ -1568,7 +1564,7 @@ private static ArrayOf<BrowseDescription> CreateBrowseDescriptionCollectionFromN
var browseDescriptionCollection = new List<BrowseDescription>();
foreach (NodeId nodeId in nodeIdCollection)
{
var browseDescription = (BrowseDescription)template.MemberwiseClone();
BrowseDescription browseDescription = CoreUtils.Clone(template);
browseDescription.NodeId = nodeId;
browseDescriptionCollection.Add(browseDescription);
}
Expand All @@ -1581,6 +1577,10 @@ private static ArrayOf<BrowseDescription> CreateBrowseDescriptionCollectionFromN
/// <param name="session">The session to use for exporting.</param>
/// <param name="nodes">The list of nodes to export.</param>
/// <param name="filePath">The path where the NodeSet2 XML file will be saved.</param>
[RequiresUnreferencedCode(
"Uses XmlSerializer which requires unreferenced code.")]
[RequiresDynamicCode(
"Uses XmlSerializer which requires unreferenced code.")]
public void ExportNodesToNodeSet2(ISession session, IList<INode> nodes, string filePath)
{
m_logger.LogInformation("Exporting {Count} nodes to {FilePath}...", nodes.Count, filePath);
Expand Down Expand Up @@ -1617,6 +1617,10 @@ public void ExportNodesToNodeSet2(ISession session, IList<INode> nodes, string f
/// <returns>A dictionary mapping namespace URI to the file path of the exported NodeSet2 file.</returns>
/// <exception cref="ArgumentNullException">Thrown when session, nodes, or outputDirectory is null.</exception>
/// <exception cref="ArgumentException">Thrown when outputDirectory is empty or whitespace.</exception>
[RequiresUnreferencedCode(
"Uses XmlSerializer which requires unreferenced code.")]
[RequiresDynamicCode(
"Uses XmlSerializer which requires unreferenced code.")]
public async Task<IReadOnlyDictionary<string, string>> ExportNodesToNodeSet2PerNamespaceAsync(
ISession session,
IList<INode> nodes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<Description>.NET Console Reference Client</Description>
<Copyright>Copyright © 2004-2024 OPC Foundation, Inc</Copyright>
<RootNamespace>Quickstarts.ConsoleReferenceClient</RootNamespace>
<PublishAot Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net10.0'))">true</PublishAot>
</PropertyGroup>
<ItemGroup>
<Compile
Expand All @@ -19,7 +20,7 @@
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="Microsoft.Extensions.Configuration" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" />
<PackageReference Include="Mono.Options" />
<PackageReference Include="System.CommandLine" />
<PackageReference Include="Serilog" />
<PackageReference Include="Serilog.Extensions.Logging" />
<PackageReference Include="Serilog.Expressions" />
Expand Down
Loading
Loading