Skip to content

Commit

Permalink
[#6741] Remove .Net Core 3.1 from projects (#6819)
Browse files Browse the repository at this point in the history
* Remove netcoreapp3.1 and fix System.Text.Json issue

* Fix System.Formats.Asn1 security issue

* Fix remaining System.Text.Json issue
  • Loading branch information
sw-joelmut authored Jul 16, 2024
1 parent 0b0db2f commit 276bb33
Show file tree
Hide file tree
Showing 55 changed files with 65 additions and 187 deletions.
15 changes: 3 additions & 12 deletions build/onebranch/ci-test-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,12 @@ steps:
customCommand: 'install -g @microsoft/botframework-cli@next'

- task: UseDotNet@2
displayName: "Install .NET Core 3.1.415"
displayName: "Install .NET Core 6.0"
continueOnError: true
inputs:
packageType: "sdk"
version: 3.1.415
condition: and(succeeded(), eq(variables['BuildConfiguration'],'Release-Windows'), eq(variables['BuildTarget'],'netcoreapp31'))

- task: DotNetCoreCLI@2
displayName: 'dotnet test (release) 3.1'
inputs:
command: test
projects: |
Tests/**/*Tests.csproj
arguments: '-v n -f netcoreapp3.1 --configuration release --no-build --no-restore --filter "TestCategory!=IgnoreInAutomatedBuild&TestCategory!=FunctionalTests" --collect:"Code Coverage" --settings $(Build.SourcesDirectory)\CodeCoverage.runsettings'
condition: and(succeeded(), eq(variables['BuildConfiguration'],'Release-Windows'), eq(variables['BuildTarget'],'netcoreapp31'))
version: 6.x
condition: and(succeeded(), eq(variables['BuildConfiguration'],'Release-Windows'), eq(variables['BuildTarget'],'net6'))

- task: DotNetCoreCLI@2
displayName: 'dotnet test (release) 6.0'
Expand Down
16 changes: 0 additions & 16 deletions build/onebranch/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ variables:
stages:
- stage: Build
jobs:
- job: Debug_Windows_Configuration_31
variables:
BuildConfiguration: Debug-Windows
BuildTarget: 'netcoreapp31' # set the TargetFramework property for tests to use netcoreapp3.1
steps:
- template: ci-build-steps.yml
- template: ci-test-steps.yml
- template: ci-component-detection-steps.yml
- job: Debug_Windows_Configuration_6
variables:
BuildConfiguration: Debug-Windows
Expand All @@ -66,14 +58,6 @@ stages:
- template: ci-build-steps.yml
- template: ci-test-steps.yml
- template: ci-component-detection-steps.yml
- job: Release_Windows_Configuration_31
variables:
BuildConfiguration: Release-Windows
BuildTarget: 'netcoreapp31' # set the TargetFramework property for tests to use netcoreapp3.1
steps:
- template: ci-build-steps.yml
- template: ci-test-steps.yml
- template: ci-component-detection-steps.yml
- job: Release_Windows_Configuration_6
variables:
BuildConfiguration: Release-Windows
Expand Down
16 changes: 0 additions & 16 deletions build/yaml/botbuilder-dotnet-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ variables:
stages:
- stage: Build
jobs:
- job: Debug_Windows_Configuration_31
variables:
BuildConfiguration: Debug-Windows
BuildTarget: 'netcoreapp31' # set the TargetFramework property for tests to use netcoreapp3.1
steps:
- template: ci-build-steps.yml
- template: ci-test-steps.yml
- template: ci-component-detection-steps.yml
- job: Debug_Windows_Configuration_6
variables:
BuildConfiguration: Debug-Windows
Expand All @@ -66,14 +58,6 @@ stages:
- template: ci-build-steps.yml
- template: ci-test-steps.yml
- template: ci-component-detection-steps.yml
- job: Release_Windows_Configuration_31
variables:
BuildConfiguration: Release-Windows
BuildTarget: 'netcoreapp31' # set the TargetFramework property for tests to use netcoreapp3.1
steps:
- template: ci-build-steps.yml
- template: ci-test-steps.yml
- template: ci-component-detection-steps.yml
- job: Release_Windows_Configuration_6
variables:
BuildConfiguration: Release-Windows
Expand Down
15 changes: 3 additions & 12 deletions build/yaml/ci-test-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,12 @@ steps:
customCommand: 'install -g @microsoft/botframework-cli@next'

- task: UseDotNet@2
displayName: "Install .NET Core 3.1.415"
displayName: "Install .NET Core 6.0"
continueOnError: true
inputs:
packageType: "sdk"
version: 3.1.415
condition: and(succeeded(), eq(variables['BuildConfiguration'],'Release-Windows'), eq(variables['BuildTarget'],'netcoreapp31'))

- task: DotNetCoreCLI@2
displayName: 'dotnet test (release) 3.1'
inputs:
command: test
projects: |
Tests/**/*Tests.csproj
arguments: '-v n -f netcoreapp3.1 --configuration release --no-build --no-restore --filter "TestCategory!=IgnoreInAutomatedBuild&TestCategory!=FunctionalTests" --collect:"Code Coverage" --settings $(Build.SourcesDirectory)\CodeCoverage.runsettings'
condition: and(succeeded(), eq(variables['BuildConfiguration'],'Release-Windows'), eq(variables['BuildTarget'],'netcoreapp31'))
version: 6.x
condition: and(succeeded(), eq(variables['BuildConfiguration'],'Release-Windows'), eq(variables['BuildTarget'],'net6'))

- task: DotNetCoreCLI@2
displayName: 'dotnet test (release) 6.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@
"description": "The target framework for the project.",
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp3.1",
"description": "Target netcoreapp3.1"
},
{
"choice": "net6.0",
"description": "Target net6.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@
"description": "The target framework for the project.",
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp3.1",
"description": "Target netcoreapp3.1"
},
{
"choice": "net6.0",
"description": "Target net6.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@
"description": "The target framework for the project.",
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp3.1",
"description": "Target netcoreapp3.1"
},
{
"choice": "net6.0",
"description": "Target net6.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="8.0.3" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
</ItemGroup>

<ItemGroup>
<!-- Force System.Text.Json to a safe version. -->
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.22" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.22" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
</ItemGroup>

<ItemGroup>
<!-- Force System.Text.Json to a safe version. -->
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="Microsoft.Bot.Configuration" Condition=" '$(ReleasePackageVersion)' == '' " Version="$(LocalPackageVersion)" />
<PackageReference Include="Microsoft.Bot.Configuration" Condition=" '$(ReleasePackageVersion)' != '' " Version="$(ReleasePackageVersion)" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Declarative" Condition=" '$(ReleasePackageVersion)' == '' " Version="$(LocalPackageVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
</PropertyGroup>

<ItemGroup>
<!-- Force System.Text.Encodings.Web to a safe version. -->
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1" />
<!-- Force System.Text.Json to a safe version. -->
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.13.0" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.24" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@


<ItemGroup>
<!-- Force System.Text.Json to a safe version. -->
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.24" />
<PackageReference Include="Azure.Storage.Queues" Version="12.11.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<PackageId>Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime</PackageId>
<Description>Library for building Adaptive Runtime bots using the Bot Framework SDK</Description>
<Summary>Library for building Adaptive Runtime bots using the Bot Framework SDK</Summary>
Expand All @@ -22,11 +22,6 @@
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<!--It is necessary to separate these conditionals in order to avoid nuget restore errors with netcoreapp3.1.-->
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
Expand All @@ -36,7 +31,6 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Text.Encodings.Web" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
</ItemGroup>

<ItemGroup>
<!-- Force System.Text.Json to a safe version. -->
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Declarative" Condition=" '$(ReleasePackageVersion)' == '' " Version="$(LocalPackageVersion)" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Declarative" Condition=" '$(ReleasePackageVersion)' != '' " Version="$(ReleasePackageVersion)" />
<PackageReference Include="Microsoft.Bot.Builder.LanguageGeneration" Condition=" '$(ReleasePackageVersion)' == '' " Version="$(LocalPackageVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
</ItemGroup>

<ItemGroup>
<!-- Force System.Formats.Asn1 to a safe version. -->
<PackageReference Include="System.Formats.Asn1" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.22" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NuGet.Packaging" Version="5.11.6" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.IO.Pipelines" Version="5.0.1" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<!-- Force System.Text.Encodings.Web to a safe version. -->
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<PackageId>Microsoft.Bot.Builder.Integration.ApplicationInsights.Core</PackageId>
<Description>This library integrates the Microsoft Bot Builder SDK with Application Insights.</Description>
<Summary>This library provides integration between the Microsoft Bot Builder SDK and Application Insights.</Summary>
Expand All @@ -20,24 +20,15 @@
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<!--It is necessary to separate these conditionals in order to avoid nuget restore errors with netcoreapp3.1.-->
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="System.Drawing.Common" Version="4.7.2" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
<!-- Force Microsoft.AspNetCore.Http to a safe version. -->
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="System.Drawing.Common" Version="4.7.2" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
<!-- Force Microsoft.AspNetCore.Http to a safe version. -->
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="System.Drawing.Common" Version="4.7.2" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
Expand All @@ -48,14 +39,14 @@
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<!-- Force Microsoft.AspNetCore.Http to a safe version. -->
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.0" />
<!-- Explicitly set dependency to the latest version, because we have a transient dependency brought by Microsoft.ApplicationInsights.AspNetCore and can't fix by updating runtime, since it's not a framework reference"-->
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1" />
<PackageReference Include="System.Drawing.Common" Version="4.7.2" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
<PackageReference Include="System.Net.Security" Version="4.3.1" />
</ItemGroup>

<ItemGroup>
<!-- Force System.Text.Json to a safe version. -->
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="Microsoft.Bot.Builder" Condition=" '$(ReleasePackageVersion)' == '' " Version="$(LocalPackageVersion)" />
<PackageReference Include="Microsoft.Bot.Builder" Condition=" '$(ReleasePackageVersion)' != '' " Version="$(ReleasePackageVersion)" />
<PackageReference Include="Microsoft.Bot.Builder.ApplicationInsights" Condition=" '$(ReleasePackageVersion)' == '' " Version="$(LocalPackageVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Description>This library integrates the Microsoft Bot Builder SDK with ASP.NET Core. It offers idiomatic configuration APIs in addition to providing all the plumbing to direct incoming bot messages to a configured bot.</Description>
<Summary>This library provides integration between the Microsoft Bot Builder SDK and ASP.NET Core.</Summary>
</PropertyGroup>
Expand All @@ -19,22 +19,15 @@
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<!--It is necessary to separate these conditionals in order to avoid nuget restore errors with netcoreapp3.1.-->
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<!-- Explicitly set to 5.0.1 for those built against 2.0-->
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.0" />
Expand All @@ -45,6 +38,8 @@
</ItemGroup>

<ItemGroup>
<!-- Force System.Text.Json to a safe version. -->
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="Microsoft.Bot.Connector.Streaming" Condition=" '$(ReleasePackageVersion)' == '' " Version="$(LocalPackageVersion)" />
<PackageReference Include="Microsoft.Bot.Connector.Streaming" Condition=" '$(ReleasePackageVersion)' != '' " Version="$(ReleasePackageVersion)" />
<PackageReference Include="Microsoft.Bot.Streaming" Condition=" '$(ReleasePackageVersion)' == '' " Version="$(LocalPackageVersion)" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework Condition="'$(BuildTarget)' == 'netcoreapp31'">netcoreapp3.1</TargetFramework>
<TargetFramework Condition="'$(BuildTarget)' == 'net6'">net6.0</TargetFramework>
<TargetFramework Condition="'$(BuildTarget)' == 'net8'">net8.0</TargetFramework>
<TargetFrameworks Condition="'$(BuildTarget)' == ''">netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(BuildTarget)' == ''">net6.0;net8.0</TargetFrameworks>

<IsPackable>false</IsPackable>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework Condition="'$(BuildTarget)' == 'netcoreapp31'">netcoreapp3.1</TargetFramework>
<TargetFramework Condition="'$(BuildTarget)' == 'net6'">net6.0</TargetFramework>
<TargetFramework Condition="'$(BuildTarget)' == 'net8'">net8.0</TargetFramework>
<TargetFrameworks Condition="'$(BuildTarget)' == ''">netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(BuildTarget)' == ''">net6.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework Condition="'$(BuildTarget)' == 'netcoreapp31'">netcoreapp3.1</TargetFramework>
<TargetFramework Condition="'$(BuildTarget)' == 'net6'">net6.0</TargetFramework>
<TargetFramework Condition="'$(BuildTarget)' == 'net8'">net8.0</TargetFramework>
<TargetFrameworks Condition="'$(BuildTarget)' == ''">netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(BuildTarget)' == ''">net6.0;net8.0</TargetFrameworks>

<IsPackable>false</IsPackable>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework Condition="'$(BuildTarget)' == 'netcoreapp31'">netcoreapp3.1</TargetFramework>
<TargetFramework Condition="'$(BuildTarget)' == 'net6'">net6.0</TargetFramework>
<TargetFramework Condition="'$(BuildTarget)' == 'net8'">net8.0</TargetFramework>
<TargetFrameworks Condition="'$(BuildTarget)' == ''">netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(BuildTarget)' == ''">net6.0;net8.0</TargetFrameworks>

<IsPackable>false</IsPackable>
<!-- The Thrzn41.WebexTeams package isn't signed, so supress the warning. There seems to not be a way to supress this for ONLY Thrzn41.WebexTeams. -->
Expand Down
Loading

0 comments on commit 276bb33

Please sign in to comment.