Skip to content

Commit

Permalink
Deprecate .NET Standard 2.0 from Nuget packages and builds (#2533)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhnaphade committed Feb 26, 2024
1 parent 0a42740 commit 0fd58b4
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 67 deletions.
9 changes: 0 additions & 9 deletions .azurepipelines/signlistDebug.txt
@@ -1,19 +1,15 @@
Stack\Opc.Ua.Core\bin\Debug\netstandard2.0\Opc.Ua.Core.dll
Stack\Opc.Ua.Core\bin\Debug\netstandard2.1\Opc.Ua.Core.dll
Stack\Opc.Ua.Core\bin\Debug\net48\Opc.Ua.Core.dll
Stack\Opc.Ua.Core\bin\Debug\net6.0\Opc.Ua.Core.dll
Stack\Opc.Ua.Core\bin\Debug\net8.0\Opc.Ua.Core.dll
Stack\Opc.Ua.Bindings.Https\bin\Debug\netstandard2.0\Opc.Ua.Bindings.Https.dll
Stack\Opc.Ua.Bindings.Https\bin\Debug\netcoreapp3.1\Opc.Ua.Bindings.Https.dll
Stack\Opc.Ua.Bindings.Https\bin\Debug\net48\Opc.Ua.Bindings.Https.dll
Stack\Opc.Ua.Bindings.Https\bin\Debug\net6.0\Opc.Ua.Bindings.Https.dll
Stack\Opc.Ua.Bindings.Https\bin\Debug\net8.0\Opc.Ua.Bindings.Https.dll
Libraries\Opc.Ua.Server\bin\Debug\netstandard2.0\Opc.Ua.Server.dll
Libraries\Opc.Ua.Server\bin\Debug\netstandard2.1\Opc.Ua.Server.dll
Libraries\Opc.Ua.Server\bin\Debug\net48\Opc.Ua.Server.dll
Libraries\Opc.Ua.Server\bin\Debug\net6.0\Opc.Ua.Server.dll
Libraries\Opc.Ua.Server\bin\Debug\net8.0\Opc.Ua.Server.dll
Libraries\Opc.Ua.Client\bin\Debug\netstandard2.0\Opc.Ua.Client.dll
Libraries\Opc.Ua.Client\bin\Debug\netstandard2.1\Opc.Ua.Client.dll
Libraries\Opc.Ua.Client\bin\Debug\net48\Opc.Ua.Client.dll
Libraries\Opc.Ua.Client\bin\Debug\net6.0\Opc.Ua.Client.dll
Expand All @@ -22,27 +18,22 @@ Libraries\Opc.Ua.Client.ComplexTypes\bin\Debug\netstandard2.1\Opc.Ua.Client.Comp
Libraries\Opc.Ua.Client.ComplexTypes\bin\Debug\net48\Opc.Ua.Client.ComplexTypes.dll
Libraries\Opc.Ua.Client.ComplexTypes\bin\Debug\net6.0\Opc.Ua.Client.ComplexTypes.dll
Libraries\Opc.Ua.Client.ComplexTypes\bin\Debug\net8.0\Opc.Ua.Client.ComplexTypes.dll
Libraries\Opc.Ua.Configuration\bin\Debug\netstandard2.0\Opc.Ua.Configuration.dll
Libraries\Opc.Ua.Configuration\bin\Debug\netstandard2.1\Opc.Ua.Configuration.dll
Libraries\Opc.Ua.Configuration\bin\Debug\net48\Opc.Ua.Configuration.dll
Libraries\Opc.Ua.Configuration\bin\Debug\net6.0\Opc.Ua.Configuration.dll
Libraries\Opc.Ua.Configuration\bin\Debug\net8.0\Opc.Ua.Configuration.dll
Libraries\Opc.Ua.Gds.Client.Common\bin\Debug\netstandard2.0\Opc.Ua.Gds.Client.Common.dll
Libraries\Opc.Ua.Gds.Client.Common\bin\Debug\netstandard2.1\Opc.Ua.Gds.Client.Common.dll
Libraries\Opc.Ua.Gds.Client.Common\bin\Debug\net48\Opc.Ua.Gds.Client.Common.dll
Libraries\Opc.Ua.Gds.Client.Common\bin\Debug\net6.0\Opc.Ua.Gds.Client.Common.dll
Libraries\Opc.Ua.Gds.Client.Common\bin\Debug\net8.0\Opc.Ua.Gds.Client.Common.dll
Libraries\Opc.Ua.Gds.Server.Common\bin\Debug\netstandard2.0\Opc.Ua.Gds.Server.Common.dll
Libraries\Opc.Ua.Gds.Server.Common\bin\Debug\netstandard2.1\Opc.Ua.Gds.Server.Common.dll
Libraries\Opc.Ua.Gds.Server.Common\bin\Debug\net48\Opc.Ua.Gds.Server.Common.dll
Libraries\Opc.Ua.Gds.Server.Common\bin\Debug\net6.0\Opc.Ua.Gds.Server.Common.dll
Libraries\Opc.Ua.Gds.Server.Common\bin\Debug\net8.0\Opc.Ua.Gds.Server.Common.dll
Libraries\Opc.Ua.Security.Certificates\bin\Debug\netstandard2.0\Opc.Ua.Security.Certificates.dll
Libraries\Opc.Ua.Security.Certificates\bin\Debug\netstandard2.1\Opc.Ua.Security.Certificates.dll
Libraries\Opc.Ua.Security.Certificates\bin\Debug\net48\Opc.Ua.Security.Certificates.dll
Libraries\Opc.Ua.Security.Certificates\bin\Debug\net6.0\Opc.Ua.Security.Certificates.dll
Libraries\Opc.Ua.Security.Certificates\bin\Debug\net8.0\Opc.Ua.Security.Certificates.dll
Libraries\Opc.Ua.PubSub\bin\Debug\netstandard2.0\Opc.Ua.PubSub.dll
Libraries\Opc.Ua.PubSub\bin\Debug\netstandard2.1\Opc.Ua.PubSub.dll
Libraries\Opc.Ua.PubSub\bin\Debug\net48\Opc.Ua.PubSub.dll
Libraries\Opc.Ua.PubSub\bin\Debug\net6.0\Opc.Ua.PubSub.dll
Expand Down
9 changes: 0 additions & 9 deletions .azurepipelines/signlistRelease.txt
@@ -1,19 +1,15 @@
Stack\Opc.Ua.Core\bin\Release\netstandard2.0\Opc.Ua.Core.dll
Stack\Opc.Ua.Core\bin\Release\netstandard2.1\Opc.Ua.Core.dll
Stack\Opc.Ua.Core\bin\Release\net48\Opc.Ua.Core.dll
Stack\Opc.Ua.Core\bin\Release\net6.0\Opc.Ua.Core.dll
Stack\Opc.Ua.Core\bin\Release\net8.0\Opc.Ua.Core.dll
Stack\Opc.Ua.Bindings.Https\bin\Release\netstandard2.0\Opc.Ua.Bindings.Https.dll
Stack\Opc.Ua.Bindings.Https\bin\Release\netcoreapp3.1\Opc.Ua.Bindings.Https.dll
Stack\Opc.Ua.Bindings.Https\bin\Release\net48\Opc.Ua.Bindings.Https.dll
Stack\Opc.Ua.Bindings.Https\bin\Release\net6.0\Opc.Ua.Bindings.Https.dll
Stack\Opc.Ua.Bindings.Https\bin\Release\net8.0\Opc.Ua.Bindings.Https.dll
Libraries\Opc.Ua.Server\bin\Release\netstandard2.0\Opc.Ua.Server.dll
Libraries\Opc.Ua.Server\bin\Release\netstandard2.1\Opc.Ua.Server.dll
Libraries\Opc.Ua.Server\bin\Release\net48\Opc.Ua.Server.dll
Libraries\Opc.Ua.Server\bin\Release\net6.0\Opc.Ua.Server.dll
Libraries\Opc.Ua.Server\bin\Release\net8.0\Opc.Ua.Server.dll
Libraries\Opc.Ua.Client\bin\Release\netstandard2.0\Opc.Ua.Client.dll
Libraries\Opc.Ua.Client\bin\Release\netstandard2.1\Opc.Ua.Client.dll
Libraries\Opc.Ua.Client\bin\Release\net48\Opc.Ua.Client.dll
Libraries\Opc.Ua.Client\bin\Release\net6.0\Opc.Ua.Client.dll
Expand All @@ -22,27 +18,22 @@ Libraries\Opc.Ua.Client.ComplexTypes\bin\Release\netstandard2.1\Opc.Ua.Client.Co
Libraries\Opc.Ua.Client.ComplexTypes\bin\Release\net48\Opc.Ua.Client.ComplexTypes.dll
Libraries\Opc.Ua.Client.ComplexTypes\bin\Release\net6.0\Opc.Ua.Client.ComplexTypes.dll
Libraries\Opc.Ua.Client.ComplexTypes\bin\Release\net8.0\Opc.Ua.Client.ComplexTypes.dll
Libraries\Opc.Ua.Configuration\bin\Release\netstandard2.0\Opc.Ua.Configuration.dll
Libraries\Opc.Ua.Configuration\bin\Release\netstandard2.1\Opc.Ua.Configuration.dll
Libraries\Opc.Ua.Configuration\bin\Release\net48\Opc.Ua.Configuration.dll
Libraries\Opc.Ua.Configuration\bin\Release\net6.0\Opc.Ua.Configuration.dll
Libraries\Opc.Ua.Configuration\bin\Release\net8.0\Opc.Ua.Configuration.dll
Libraries\Opc.Ua.Gds.Client.Common\bin\Release\netstandard2.0\Opc.Ua.Gds.Client.Common.dll
Libraries\Opc.Ua.Gds.Client.Common\bin\Release\netstandard2.1\Opc.Ua.Gds.Client.Common.dll
Libraries\Opc.Ua.Gds.Client.Common\bin\Release\net48\Opc.Ua.Gds.Client.Common.dll
Libraries\Opc.Ua.Gds.Client.Common\bin\Release\net6.0\Opc.Ua.Gds.Client.Common.dll
Libraries\Opc.Ua.Gds.Client.Common\bin\Release\net8.0\Opc.Ua.Gds.Client.Common.dll
Libraries\Opc.Ua.Gds.Server.Common\bin\Release\netstandard2.0\Opc.Ua.Gds.Server.Common.dll
Libraries\Opc.Ua.Gds.Server.Common\bin\Release\netstandard2.1\Opc.Ua.Gds.Server.Common.dll
Libraries\Opc.Ua.Gds.Server.Common\bin\Release\net48\Opc.Ua.Gds.Server.Common.dll
Libraries\Opc.Ua.Gds.Server.Common\bin\Release\net6.0\Opc.Ua.Gds.Server.Common.dll
Libraries\Opc.Ua.Gds.Server.Common\bin\Release\net8.0\Opc.Ua.Gds.Server.Common.dll
Libraries\Opc.Ua.Security.Certificates\bin\Release\netstandard2.0\Opc.Ua.Security.Certificates.dll
Libraries\Opc.Ua.Security.Certificates\bin\Release\netstandard2.1\Opc.Ua.Security.Certificates.dll
Libraries\Opc.Ua.Security.Certificates\bin\Release\net48\Opc.Ua.Security.Certificates.dll
Libraries\Opc.Ua.Security.Certificates\bin\Release\net6.0\Opc.Ua.Security.Certificates.dll
Libraries\Opc.Ua.Security.Certificates\bin\Release\net8.0\Opc.Ua.Security.Certificates.dll
Libraries\Opc.Ua.PubSub\bin\Release\netstandard2.0\Opc.Ua.PubSub.dll
Libraries\Opc.Ua.PubSub\bin\Release\netstandard2.1\Opc.Ua.PubSub.dll
Libraries\Opc.Ua.PubSub\bin\Release\net48\Opc.Ua.PubSub.dll
Libraries\Opc.Ua.PubSub\bin\Release\net6.0\Opc.Ua.PubSub.dll
Expand Down
6 changes: 3 additions & 3 deletions Docs/PlatformBuild.md
Expand Up @@ -50,17 +50,17 @@ The following platform is deprecated but can still be built and tested:
To reduce the ci build overhead and the number of tests to be run in Visual Studio, only the tagged versions (* and **) are part of a qualifying ci build to pass a pull request.
All other platforms are only tested in weekly scheduled or manual ci builds.

By default, in Visual Studio only the platforms tagged with (*) are tested. In order to test the other platforms in a command line window or in VS, there is a custom build variable defined to target a specific build. E.g. to target a .NETStandard2.0 build, the test runners are compiled with .NET 6.0 but the class libraries target only netstandard2.0, to force the use of that target.
By default, in Visual Studio only the platforms tagged with (*) are tested. In order to test the other platforms in a command line window or in VS, there is a custom build variable defined to target a specific build. E.g. to target a .NETStandard2.1 build, the test runners are compiled with .NET 6.0 but the class libraries target only netstandard2.1, to force the use of that target.
Another option is to test run such a custom target in a command window with a batch file [CustomTest.bat](../Tests/customtest.bat) which is provided to clean up, restore the project and to run the tests. To run the custom tests in Visual Studio a section in [target.props](../targets.props) needs to be uncommented and the target platform value must be set.

```xml
<!--
Uncomment the following lines to test a custom test target
supported values: net462, netstandard2.0, netstandard2.1, net48, net6.0, net8.0
supported values: net462, netstandard2.1, net48, net6.0, net8.0
-->

<PropertyGroup>
<CustomTestTarget>netstandard2.0</CustomTestTarget>
<CustomTestTarget>netstandard2.1</CustomTestTarget>
</PropertyGroup>
```

Expand Down
Expand Up @@ -21,11 +21,6 @@
<PackageReference Include="BouncyCastle.Cryptography" Version="2.2.1" />
</ItemGroup>
</When>
<When Condition="'$(TargetFramework)' == 'netstandard2.0'">
<ItemGroup>
<PackageReference Include="BouncyCastle.Cryptography" Version="2.2.1" />
</ItemGroup>
</When>
<Otherwise>
<PropertyGroup>
<DefineConstants>$(DefineConstants);ECC_SUPPORT</DefineConstants>
Expand Down
4 changes: 0 additions & 4 deletions Stack/Opc.Ua.Bindings.Https/Opc.Ua.Bindings.Https.csproj
Expand Up @@ -49,10 +49,6 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net48'">
<Reference Include="System.Net.Http" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.Net.Http" Version="4.3.4" />
Expand Down
2 changes: 1 addition & 1 deletion Stack/Opc.Ua.Core/Opc.Ua.Core.csproj
Expand Up @@ -70,7 +70,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'net472' OR '$(TargetFramework)' == 'net48'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'net472' OR '$(TargetFramework)' == 'net48'">
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
</ItemGroup>

Expand Down
Expand Up @@ -10,8 +10,6 @@
<Choose>
<When Condition="'$(TargetFramework)' == 'net462'">
</When>
<When Condition="'$(TargetFramework)' == 'netstandard2.0'">
</When>
<Otherwise>
<PropertyGroup Condition="'$(DisableECCTests)' != 'true'">
<DefineConstants>$(DefineConstants);ECC_SUPPORT</DefineConstants>
Expand Down
8 changes: 4 additions & 4 deletions Tests/customtest.bat
Expand Up @@ -2,19 +2,19 @@
setlocal enabledelayedexpansion

echo This script is used to run custom platform tests for the UA Core Library
echo Supported parameters: net462, netstandard2.0, netstandard2.1, net48, net6.0, net8.0
echo Supported parameters: net462, netstandard2.1, net48, net6.0, net8.0

REM Check if the target framework parameter is provided
if "%1"=="" (
echo Usage: %0 [TargetFramework]
echo Allowed values for TargetFramework: net462, netstandard2.0, netstandard2.1, net48, net6.0, net8.0, default
echo Allowed values for TargetFramework: net462, netstandard2.1, net48, net6.0, net8.0, default
goto :eof
)

REM Check if the provided TargetFramework is valid
set "validFrameworks= default net462 netstandard2.0 netstandard2.1 net48 net6.0 net8.0"
set "validFrameworks= default net462 netstandard2.1 net48 net6.0 net8.0"
if "!validFrameworks: %1 =!"=="%validFrameworks%" (
echo Invalid TargetFramework specified. Allowed values are: default, net462, netstandard2.0, netstandard2.1, net48, net6.0, net8.0
echo Invalid TargetFramework specified. Allowed values are: default, net462, netstandard2.1, net48, net6.0, net8.0
goto :eof
)

Expand Down
12 changes: 0 additions & 12 deletions azure-pipelines.yml
Expand Up @@ -114,18 +114,6 @@ stages:
jobnamesuffix: net462
agents: '@{ windows = "windows-2022" }'
customtestarget: net462
- stage: testnetstandard20
dependsOn: [build]
displayName: 'Test .NETStandard 2.0'
condition: and(succeeded(), ne(variables.ScheduledBuild, 'False'))
jobs:
- template: .azurepipelines/test.yml
parameters:
framework: net6.0
configuration: Release
jobnamesuffix: netstandard20
agents: '@{ windows = "windows-2019"; linux="ubuntu-20.04"}'
customtestarget: netstandard2.0
- stage: testnetstandard21
dependsOn: [build]
displayName: 'Test .NETStandard 2.1'
Expand Down
24 changes: 6 additions & 18 deletions targets.props
Expand Up @@ -12,11 +12,11 @@
A build with all custom targets which are not part of a regular build
is scheduled once a week in the DevOps build pipeline.
Uncomment the following lines to test a custom test target
supported values: net462, netstandard2.0, netstandard2.1, net48, net6.0, net8.0
supported values: net462, netstandard2.1, net48, net6.0, net8.0
-->
<!--
<PropertyGroup>
<CustomTestTarget>netstandard2.0</CustomTestTarget>
<CustomTestTarget>netstandard2.1</CustomTestTarget>
</PropertyGroup>
-->
<Choose>
Expand All @@ -34,18 +34,6 @@
<HttpsTargetFrameworks>net462</HttpsTargetFrameworks>
</PropertyGroup>
</When>
<When Condition="'$(CustomTestTarget)' == 'netstandard2.0'">
<PropertyGroup>
<DisableECCTests>true</DisableECCTests>
<AnalysisLevel>preview-all</AnalysisLevel>
<AppTargetFrameworks>net6.0</AppTargetFrameworks>
<AppTargetFramework>net6.0</AppTargetFramework>
<TestsTargetFrameworks>net6.0</TestsTargetFrameworks>
<LibTargetFrameworks>netstandard2.0</LibTargetFrameworks>
<LibxTargetFrameworks>netstandard2.1</LibxTargetFrameworks>
<HttpsTargetFrameworks>netstandard2.0</HttpsTargetFrameworks>
</PropertyGroup>
</When>
<When Condition="'$(CustomTestTarget)' == 'netstandard2.1'">
<PropertyGroup>
<AnalysisLevel>preview-all</AnalysisLevel>
Expand Down Expand Up @@ -99,9 +87,9 @@
<AppTargetFrameworks>net6.0;net48</AppTargetFrameworks>
<AppTargetFramework>net6.0</AppTargetFramework>
<TestsTargetFrameworks>net48;net6.0</TestsTargetFrameworks>
<LibTargetFrameworks>net48;netstandard2.0;netstandard2.1;net6.0;net8.0</LibTargetFrameworks>
<LibTargetFrameworks>net48;netstandard2.1;net6.0;net8.0</LibTargetFrameworks>
<LibxTargetFrameworks>net48;netstandard2.1;net6.0;net8.0</LibxTargetFrameworks>
<HttpsTargetFrameworks>net48;netstandard2.0;netcoreapp3.1;net6.0;net8.0</HttpsTargetFrameworks>
<HttpsTargetFrameworks>net48;netcoreapp3.1;net6.0;net8.0</HttpsTargetFrameworks>
</PropertyGroup>
</When>
<!-- Visual Studio 2019, supports .NET Framework 4.8 and .NET Core 3.1 -->
Expand All @@ -111,9 +99,9 @@
<AppTargetFrameworks>netcoreapp3.1;net48</AppTargetFrameworks>
<AppTargetFramework>netcoreapp3.1</AppTargetFramework>
<TestsTargetFrameworks>net48;netcoreapp3.1</TestsTargetFrameworks>
<LibTargetFrameworks>net48;netstandard2.0;netstandard2.1</LibTargetFrameworks>
<LibTargetFrameworks>net48;netstandard2.1</LibTargetFrameworks>
<LibxTargetFrameworks>net48;netstandard2.1</LibxTargetFrameworks>
<HttpsTargetFrameworks>net48;netstandard2.0;netcoreapp3.1</HttpsTargetFrameworks>
<HttpsTargetFrameworks>net48;netcoreapp3.1</HttpsTargetFrameworks>
</PropertyGroup>
</When>
<!-- Visual Studio 2017 and earlier, support only .NET Framework 4.8 because .NET Core 2.x is end of life. -->
Expand Down

0 comments on commit 0fd58b4

Please sign in to comment.