Skip to content

Commit 5379704

Browse files
Target NetFrameworkCurrent in tests and remove old mentions (#113667)
* Target NetFrameworkCurrent in tests and remove old mentions ... of previous .NET Framework versions in docs / tests. NetFrameworkMinimum (net462) -> NetFrameworkCurrent (net481) so that we can start consuming xunit v3 which requires at least net472. Use NetFrameworkCurrent as the actual runtime that is then used is .NET Framework 4.8.1 anyway (innerloop & CI). * Revert source-generator ref assembly change * Try to fix VoidMainWithExitCodeApp test * Fix typo --------- Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
1 parent 255baa0 commit 5379704

File tree

135 files changed

+242
-225
lines changed

Some content is hidden

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

135 files changed

+242
-225
lines changed

Directory.Build.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@
8282
<AspNetCoreAppCurrentVersion>10.0</AspNetCoreAppCurrentVersion>
8383
<AspNetCoreAppCurrent>net$(AspNetCoreAppCurrentVersion)</AspNetCoreAppCurrent>
8484

85-
<NetFrameworkMinimum>net462</NetFrameworkMinimum>
86-
<NetFrameworkCurrent>net48</NetFrameworkCurrent>
87-
<NetFrameworkToolCurrent>net472</NetFrameworkToolCurrent>
8885
<!-- Don't build for NETFramework during source-build. -->
8986
<NetFrameworkMinimum Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
9087
<NetFrameworkToolCurrent Condition="'$(DotNetBuildSourceOnly)' == 'true'" />

docs/coding-guidelines/project-guidelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ When building an individual project the `BuildTargetFramework` and `TargetOS` wi
6969

7070
## Supported full build settings
7171
- .NET Core latest on current OS (default) -> `$(NetCoreAppCurrent)-[RunningOS]`
72-
- .NET Framework latest -> `net48`
72+
- .NET Framework latest -> `net481`
7373

7474
# Library project guidelines
7575

docs/workflow/building/libraries/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The libraries build has two logical components, the native build which produces
7676

7777
The build settings (BuildTargetFramework, TargetOS, Configuration, Architecture) are generally defaulted based on where you are building (i.e. which OS or which architecture) but we have a few shortcuts for the individual properties that can be passed to the build scripts:
7878

79-
- `-framework|-f` identifies the target framework for the build. Possible values include `net10.0` (currently the latest .NET version) or `net48` (the latest .NET Framework version). (msbuild property `BuildTargetFramework`)
79+
- `-framework|-f` identifies the target framework for the build. Possible values include `net10.0` (currently the latest .NET version) or `net481` (the latest .NET Framework version). (msbuild property `BuildTargetFramework`)
8080
- `-os` identifies the OS for the build. It defaults to the OS you are running on but possible values include `windows`, `unix`, `linux`, or `osx`. (msbuild property `TargetOS`)
8181
- `-configuration|-c Debug|Release` controls the optimization level the compilers use for the build. It defaults to `Debug`. (msbuild property `Configuration`)
8282
- `-arch` identifies the architecture for the build. It defaults to `x64` but possible values include `x64`, `x86`, `arm`, or `arm64`. (msbuild property `TargetArchitecture`)

eng/build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function Get-Help() {
7878

7979
Write-Host "Libraries settings:"
8080
Write-Host " -coverage Collect code coverage when testing."
81-
Write-Host " -framework (-f) Build framework: net10.0 or net48."
81+
Write-Host " -framework (-f) Build framework: net10.0 or net481."
8282
Write-Host " [Default: net10.0]"
8383
Write-Host " -testnobuild Skip building tests when invoking -test."
8484
Write-Host " -testscope Scope tests, allowed values: innerloop, outerloop, all."

eng/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ usage()
6666

6767
echo "Libraries settings:"
6868
echo " --coverage Collect code coverage when testing."
69-
echo " --framework (-f) Build framework: net10.0 or net48."
69+
echo " --framework (-f) Build framework: net10.0 or net481."
7070
echo " [Default: net10.0]"
7171
echo " --testnobuild Skip building tests when invoking -test."
7272
echo " --testscope Test scope, allowed values: innerloop, outerloop, all."

eng/pipelines/extra-platforms/runtime-extra-platforms-other.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
4141
eq(variables['isRollingBuild'], true))
4242
43-
# Run net48 tests on win-x64
43+
# Run net481 tests on win-x64
4444
- template: /eng/pipelines/common/platform-matrix.yml
4545
parameters:
4646
jobTemplate: /eng/pipelines/common/global-build-job.yml
@@ -49,16 +49,16 @@ jobs:
4949
- windows_x64
5050
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
5151
jobParameters:
52-
framework: net48
53-
buildArgs: -s tools+libs+libs.tests -framework net48 -c $(_BuildConfig) -testscope innerloop /p:ArchiveTests=true
54-
nameSuffix: Libraries_NET48
52+
framework: net481
53+
buildArgs: -s tools+libs+libs.tests -framework net481 -c $(_BuildConfig) -testscope innerloop /p:ArchiveTests=true
54+
nameSuffix: Libraries_NET481
5555
timeoutInMinutes: 150
5656
postBuildSteps:
5757
- template: /eng/pipelines/libraries/helix.yml
5858
parameters:
5959
creator: dotnet-bot
60-
testRunNamePrefixSuffix: NET48_$(_BuildConfig)
61-
extraHelixArguments: /p:BuildTargetFramework=net48
60+
testRunNamePrefixSuffix: NET481_$(_BuildConfig)
61+
extraHelixArguments: /p:BuildTargetFramework=net481
6262
isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
6363
condition: >-
6464
or(

eng/pipelines/libraries/helix-queues-setup.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
# windows x64
116116
- ${{ if eq(parameters.platform, 'windows_x64') }}:
117117
# netcoreapp
118-
- ${{ if notIn(parameters.jobParameters.framework, 'net48') }}:
118+
- ${{ if notIn(parameters.jobParameters.framework, 'net481') }}:
119119
# libraries on mono outerloop
120120
- ${{ if and(eq(parameters.jobParameters.testScope, 'outerloop'), eq(parameters.jobParameters.runtimeFlavor, 'mono')) }}:
121121
- Windows.Amd64.Server2022.Open
@@ -137,14 +137,14 @@ jobs:
137137
- (Windows.Nano.1809.Amd64.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:nanoserver-1809-helix-amd64
138138

139139
# .NETFramework
140-
- ${{ if eq(parameters.jobParameters.framework, 'net48') }}:
140+
- ${{ if eq(parameters.jobParameters.framework, 'net481') }}:
141141
- Windows.11.Amd64.Client.Open
142142

143143

144144
# windows x86
145145
- ${{ if eq(parameters.platform, 'windows_x86') }}:
146146
# netcoreapp
147-
- ${{ if notIn(parameters.jobParameters.framework, 'net48') }}:
147+
- ${{ if notIn(parameters.jobParameters.framework, 'net481') }}:
148148
# mono outerloop
149149
- ${{ if and(eq(parameters.jobParameters.testScope, 'outerloop'), eq(parameters.jobParameters.runtimeFlavor, 'mono')) }}:
150150
- Windows.11.Amd64.Client.Open
@@ -155,7 +155,7 @@ jobs:
155155
- Windows.11.Amd64.Client.Open
156156

157157
# .NETFramework
158-
- ${{ if eq(parameters.jobParameters.framework, 'net48') }}:
158+
- ${{ if eq(parameters.jobParameters.framework, 'net481') }}:
159159
- Windows.10.Amd64.Client.Open
160160

161161
# windows arm64

eng/pipelines/libraries/outerloop.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ extends:
9292
- ${{ if eq(variables['isRollingBuild'], true) }}:
9393
- windows_x64
9494
jobParameters:
95-
framework: net48
95+
framework: net481
9696
testScope: outerloop
97-
nameSuffix: NET48
98-
buildArgs: -s libs+libs.tests -c $(_BuildConfig) -testscope outerloop /p:ArchiveTests=true -f net48
97+
nameSuffix: NET481
98+
buildArgs: -s libs+libs.tests -c $(_BuildConfig) -testscope outerloop /p:ArchiveTests=true -f net481
9999
timeoutInMinutes: 180
100100
includeAllPlatforms: ${{ variables['isRollingBuild'] }}
101101
# extra steps, run tests
@@ -104,4 +104,4 @@ extends:
104104
parameters:
105105
testScope: outerloop
106106
creator: dotnet-bot
107-
extraHelixArguments: /p:BuildTargetFramework=net48
107+
extraHelixArguments: /p:BuildTargetFramework=net481

eng/pipelines/runtime.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,16 +1234,16 @@ extends:
12341234
- windows_x86
12351235
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
12361236
jobParameters:
1237-
framework: net48
1238-
buildArgs: -s tools+libs+libs.tests -framework net48 -c $(_BuildConfig) -testscope innerloop /p:ArchiveTests=true
1239-
nameSuffix: Libraries_NET48
1237+
framework: net481
1238+
buildArgs: -s tools+libs+libs.tests -framework net481 -c $(_BuildConfig) -testscope innerloop /p:ArchiveTests=true
1239+
nameSuffix: Libraries_NET481
12401240
timeoutInMinutes: 150
12411241
postBuildSteps:
12421242
- template: /eng/pipelines/libraries/helix.yml
12431243
parameters:
12441244
creator: dotnet-bot
1245-
testRunNamePrefixSuffix: NET48_$(_BuildConfig)
1246-
extraHelixArguments: /p:BuildTargetFramework=net48
1245+
testRunNamePrefixSuffix: NET481_$(_BuildConfig)
1246+
extraHelixArguments: /p:BuildTargetFramework=net481
12471247
condition: >-
12481248
or(
12491249
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),

src/libraries/Common/tests/TestUtilities/TestUtilities.csproj

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3+
<TargetFrameworks>$(NetCoreAppMinimum);$(NetFrameworkCurrent)</TargetFrameworks>
34
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
45
<!-- For some reason, xunit.core.props isn't excluded in VS and sets this to true. -->
56
<IsTestProject>false</IsTestProject>
6-
<!--
7-
This assembly is referenced from rid agnostic configurations therefore we can't make it RID specific
8-
and instead use runtime checks.
9-
-->
10-
<TargetFrameworks>$(NetCoreAppMinimum);$(NetFrameworkMinimum)</TargetFrameworks>
117
</PropertyGroup>
8+
129
<ItemGroup>
1310
<EmbeddedResource Include="$(MSBuildThisFileDirectory)ILLink.Substitutions.AggressiveTrimming.xml"
1411
LogicalName="ILLink.Substitutions.xml"
@@ -50,6 +47,7 @@
5047

5148
<Compile Include="TestEventListener.cs" />
5249
</ItemGroup>
50+
5351
<!-- Windows imports -->
5452
<ItemGroup>
5553
<Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CreateFile.cs"
@@ -84,6 +82,7 @@
8482
<Compile Include="$(CommonPath)System\IO\PathInternal.Windows.cs"
8583
Link="Common\System\IO\PathInternal.Windows.cs" />
8684
</ItemGroup>
85+
8786
<!-- Unix imports -->
8887
<ItemGroup>
8988
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs"
@@ -97,23 +96,28 @@
9796
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetEUid.cs"
9897
Link="Common\Interop\Unix\Interop.GetEUid.cs" />
9998
</ItemGroup>
99+
100100
<!-- Android imports -->
101101
<ItemGroup>
102102
<Compile Include="$(CommonPath)Interop\Android\Interop.Libraries.cs"
103103
Link="Common\Interop\Android\Interop.Libraries.cs" />
104104
<Compile Include="$(CommonPath)Interop\Android\System.Security.Cryptography.Native.Android\Interop.Ssl.ProtocolSupport.cs"
105105
Link="Common\Interop\Android\System.Security.Cryptography.Native.Android\Interop.Ssl.ProtocolSupport.cs" />
106106
</ItemGroup>
107+
107108
<ItemGroup>
108109
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" Version="$(MicrosoftDotNetXUnitExtensionsVersion)" />
109110
<PackageReference Include="xunit.core" Version="$(XUnitVersion)" ExcludeAssets="build" />
110111
</ItemGroup>
112+
111113
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
112114
<!-- Use the arcade fork of xunit.assert for AOT-compat -->
113115
<PackageReference Include="Microsoft.DotNet.XUnitAssert" Version="$(MicrosoftDotNetXUnitAssertVersion)" />
114116
</ItemGroup>
117+
115118
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
116119
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
117120
<PackageReference Include="xunit.assert" Version="$(XUnitVersion)" />
118121
</ItemGroup>
122+
119123
</Project>

0 commit comments

Comments
 (0)