Skip to content

Commit 3124e2f

Browse files
marcschierromanett
andauthored
Integration of 1.5.378 preview nugets (#672)
* Pass Telemetry context * Update all calls to obsolete methods * target net 10 --------- Co-authored-by: Roman Ettlinger <[email protected]>
1 parent 0a7e3d9 commit 3124e2f

File tree

321 files changed

+3501
-2293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

321 files changed

+3501
-2293
lines changed

.azurepipelines/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- job: buildprep
99
displayName: Prepare Build Jobs
1010
pool:
11-
vmImage: 'windows-2019'
11+
vmImage: 'windows-2022'
1212
variables:
1313
DOTNET_CLI_TELEMETRY_OPTOUT: true
1414
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
@@ -31,7 +31,12 @@ jobs:
3131
- task: NuGetAuthenticate@1
3232
- task: NuGetToolInstaller@1
3333
inputs:
34-
versionSpec: '>=5.8.x'
34+
versionSpec: '>=7.0.x'
35+
- task: UseDotNet@2
36+
displayName: 'Install .NET 10.0'
37+
inputs:
38+
packageType: 'sdk'
39+
version: '10.0.x'
3540
- task: DotNetCoreCLI@2
3641
displayName: Release Restore
3742
inputs:

.azurepipelines/get-matrix.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if ($AgentTable -eq $null -or $AgentTable.Count -eq 0)
4545
$agents = @{
4646
windows = "windows-2022"
4747
linux = "ubuntu-22.04"
48-
mac = "macOS-13"
48+
mac = "macOS-15"
4949
}
5050
}
5151
else {

.azurepipelines/sln.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@ jobs:
88
vmImage: 'windows-2022'
99
steps:
1010
- task: NuGetAuthenticate@1
11+
- task: UseDotNet@2
12+
displayName: 'Install .NET 10.0'
13+
inputs:
14+
packageType: 'sdk'
15+
version: '10.0.x'
1116
- task: NuGetToolInstaller@1
1217
inputs:
13-
versionSpec: '>=5.8.x'
18+
versionSpec: '>=7.0.x'
1419
- task: NuGetCommand@2
1520
displayName: Restore Release
1621
inputs:

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,9 @@ dotnet_diagnostic.CA1859.severity = silent
578578
# CA1861: Avoid constant arrays as arguments
579579
dotnet_diagnostic.CA1861.severity = silent
580580

581+
# CA1848: Use the LoggerMessage delegates
582+
dotnet_diagnostic.CA1848.severity = suggestion
583+
581584
[**/Generated/*.cs]
582585
generated_code = true
583586
dotnet_diagnostic.severity = none

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ jobs:
4848
# Prefix the list here with "+" to use these queries and those in the config file.
4949
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5050

51-
- name: Setup .NET
51+
- name: Set up .NET
5252
uses: actions/setup-dotnet@v5
5353
with:
54-
dotnet-version: '6.x' # SDK Version to use;
54+
dotnet-version: '10.x'
5555

5656
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
5757
- name: Setup MSBuild.exe

Samples/Client.Net4/Program.cs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,29 @@
2929

3030
using System;
3131
using System.Windows.Forms;
32-
using Opc.Ua.Configuration;
32+
using Microsoft.Extensions.Logging;
3333
using Opc.Ua.Client.Controls;
34+
using Opc.Ua.Configuration;
3435

3536
namespace Opc.Ua.Sample
3637
{
38+
public sealed class ConsoleTelemetry : TelemetryContextBase
39+
{
40+
public ConsoleTelemetry()
41+
: base(
42+
Microsoft.Extensions.Logging.LoggerFactory.Create(builder =>
43+
{
44+
builder.SetMinimumLevel(LogLevel.Information);
45+
builder.AddConsole();
46+
})
47+
)
48+
{
49+
}
50+
}
3751
static class Program
3852
{
53+
private static readonly ITelemetryContext m_telemetry = new ConsoleTelemetry();
54+
3955
/// <summary>
4056
/// The main entry point for the application.
4157
/// </summary>
@@ -46,7 +62,7 @@ static void Main()
4662
Application.SetCompatibleTextRenderingDefault(false);
4763

4864
ApplicationInstance.MessageDlg = new ApplicationMessageDlg();
49-
ApplicationInstance application = new ApplicationInstance();
65+
ApplicationInstance application = new ApplicationInstance(m_telemetry);
5066
application.ApplicationName = "UA Sample Client";
5167
application.ApplicationType = ApplicationType.ClientAndServer;
5268
application.ConfigSectionName = "Opc.Ua.SampleClient";
@@ -66,11 +82,11 @@ static void Main()
6682
application.StartAsync(new SampleServer()).Wait();
6783

6884
// run the application interactively.
69-
Application.Run(new SampleClientForm(application, null, application.ApplicationConfiguration));
85+
Application.Run(new SampleClientForm(application, null, application.ApplicationConfiguration, m_telemetry));
7086
}
7187
catch (Exception e)
7288
{
73-
ExceptionDlg.Show(application.ApplicationName, e);
89+
ExceptionDlg.Show(m_telemetry, application.ApplicationName, e);
7490
}
7591
}
7692
}

Samples/Client.Net4/SampleClientForm.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved.
33
*
44
* OPC Foundation MIT License 1.00
5-
*
5+
*
66
* Permission is hereby granted, free of charge, to any person
77
* obtaining a copy of this software and associated documentation
88
* files (the "Software"), to deal in the Software without
@@ -11,7 +11,7 @@
1111
* copies of the Software, and to permit persons to whom the
1212
* Software is furnished to do so, subject to the following
1313
* conditions:
14-
*
14+
*
1515
* The above copyright notice and this permission notice shall be
1616
* included in all copies or substantial portions of the Software.
1717
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
@@ -45,9 +45,10 @@ public SampleClientForm()
4545
public SampleClientForm(
4646
ApplicationInstance application,
4747
ClientForm masterForm,
48-
ApplicationConfiguration configuration)
48+
ApplicationConfiguration configuration,
49+
ITelemetryContext telemetry)
4950
:
50-
base(configuration.CreateMessageContext(), application, masterForm, configuration)
51+
base(configuration.CreateMessageContext(), application, masterForm, configuration, telemetry)
5152
{
5253
InitializeComponent();
5354

@@ -71,7 +72,7 @@ void CertificateValidator_CertificateValidation(CertificateValidator validator,
7172
}
7273
catch (Exception exception)
7374
{
74-
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
75+
GuiUtils.HandleException(m_telemetry, this.Text, MethodBase.GetCurrentMethod(), exception);
7576
}
7677
}
7778
}

Samples/Client.Net4/UA Sample Client.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@
137137
</ItemGroup>
138138
<ItemGroup>
139139
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions">
140-
<Version>9.0.8</Version>
140+
<Version>10.0.0</Version>
141141
</PackageReference>
142142
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Bindings.Https">
143-
<Version>1.5.377.21</Version>
143+
<Version>1.5.378.11-preview</Version>
144144
</PackageReference>
145145
<PackageReference Include="System.Net.Http">
146146
<Version>4.3.4</Version>

Samples/ClientControls.Net4/Browse/AttributeListCtrl.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public async Task InitializeAsync(ISession session, ExpandedNodeId nodeId, Cance
7878
{
7979
ItemsLV.Items.Clear();
8080
m_session = session;
81+
Telemetry = session?.MessageContext?.Telemetry;
8182

8283
if (m_session == null)
8384
{
@@ -414,7 +415,7 @@ protected override async Task UpdateItemAsync(ListViewItem listItem, object item
414415
}
415416
catch (Exception exception)
416417
{
417-
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
418+
GuiUtils.HandleException(Telemetry, this.Text, MethodBase.GetCurrentMethod(), exception);
418419
}
419420
}
420421
#endregion

Samples/ClientControls.Net4/Browse/BrowseListCtrl.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public async Task InitializeAsync(ISession session, ExpandedNodeId nodeId, Cance
7272
{
7373
ItemsLV.Items.Clear();
7474
m_session = session;
75+
Telemetry = session?.MessageContext?.Telemetry;
7576

7677
if (m_session == null)
7778
{
@@ -152,7 +153,7 @@ protected override async Task UpdateItemAsync(ListViewItem listItem, object item
152153
}
153154
catch (Exception exception)
154155
{
155-
GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
156+
GuiUtils.HandleException(m_session?.MessageContext?.Telemetry, this.Text, MethodBase.GetCurrentMethod(), exception);
156157
}
157158
}
158159
#endregion

0 commit comments

Comments
 (0)