Skip to content

Conversation

@marcschier
Copy link
Collaborator

@marcschier marcschier commented Feb 9, 2026

Proposed changes

PR Classification

Code cleanup and modernization to align with latest C# and .NET best practices, and to remove legacy .NET Standard 2.0 support.

PR Summary

This pull request modernizes the OPC UA .NET codebase and tests, removes .NET Standard 2.0 support from certificate/security code, and updates test code to use C# 12 and .NET 8+ features for clarity and maintainability.

  • Certificate and BouncyCastle interop files (e.g., CertificateBuilder.cs, X509Extensions.cs, X509SignatureFactory.cs) are refactored to drop NETSTANDARD2_0 support and use modern .NET APIs and conditional compilation.
  • Test code across the codebase is updated to use default, strongly-typed Parse methods, collection expressions, and improved async/await patterns.
  • Exception handling and assertions in tests are modernized, and test method naming is made consistent with Async suffixes.
  • The project and build files are updated to clarify Roslynator analyzer usage and remove obsolete netstandard tags.
  • General code and test cleanup includes improved null safety, type safety, and removal of deprecated or unused code.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply. You can also fill these out after creating the PR.

  • Bugfix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Test enhancement (non-breaking change to increase test coverage)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@marcschier marcschier changed the title Update Code clean up and improvements Feb 9, 2026
@marcschier marcschier requested a review from romanett February 9, 2026 08:03
@marcschier marcschier marked this pull request as ready for review February 9, 2026 09:00
NonMetadata = MessageType | DataSetMetaData,

MetaData_Name,
MetaData_Description,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not familiar with this area, but why was this removed? not needed any more?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not used, you cannot fail for missing description, because it was set to null in the configuration.

public object SystemHandle { get; set; }

/// <inheritdoc/>
public string UserId => UserIdentity?.DisplayName;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really an OPC UA semantic?
Not shure why it is added here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to pull this into the interface so it can be pulled into condition state and audit event state from system context (without these areas to understand "user tokens").

/// Encodeable activator
/// </summary>
/// <typeparam name="T"></typeparam>
public abstract class EncodeableType<T> : IEncodeableType
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in this PR for a reason?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason - in fact we can likely remove this although, let me do that in the next PR if there are no glaring other issues.

</xs:sequence>
<xs:attribute name="Name" type="xs:string" use="optional" />
<xs:attribute name="Value" type="xs:int" use="optional" />
<xs:attribute name="Value" type="xs:unsignedLong" use="optional" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be changed in ModelCompilerRepo as well or is this only present in UANetstandard?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already changed there, this is the copy

@marcschier marcschier merged commit 43ce7ed into master Feb 9, 2026
146 of 148 checks passed
@marcschier marcschier deleted the prepare branch February 9, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants