Skip to content

Commit 2d6cc77

Browse files
authored
Add NetCoreAppCurrent configurations to Microsoft.Extensions libraries (#61867)
* Add NetCoreAppCurrent configurations to Microsoft.Extensions libraries This makes all Extensions projects consistent in which TFMs they target. This way we don't need to add new TFMs during development of a new feature. Fix #54012
1 parent 7a62468 commit 2d6cc77

File tree

68 files changed

+335
-126
lines changed

Some content is hidden

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

68 files changed

+335
-126
lines changed

src/libraries/Common/src/System/Runtime/InteropServices/ArrayMarshaller.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
#nullable enable
5+
46
//
57
// Types in this file are used for generated p/invokes (docs/design/features/source-generator-pinvokes.md).
68
// See the DllImportGenerator experiment in https://github.com/dotnet/runtimelab.

src/libraries/Common/src/System/Runtime/InteropServices/GeneratedMarshallingAttribute.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
#nullable enable
5+
46
//
57
// Types in this file are used for generated p/invokes (docs/design/features/source-generator-pinvokes.md).
68
// See the DllImportGenerator experiment in https://github.com/dotnet/runtimelab.
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
3+
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
44
</PropertyGroup>
5+
56
<ItemGroup>
67
<Compile Include="Microsoft.Extensions.Caching.Abstractions.cs" />
78
<ProjectReference Include="..\..\Microsoft.Extensions.Primitives\ref\Microsoft.Extensions.Primitives.csproj" />
89
</ItemGroup>
10+
11+
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(TargetFramework)' != '$(NetCoreAppCurrent)'">
12+
<Reference Include="System.Runtime" />
13+
</ItemGroup>
914
</Project>

src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Microsoft.Extensions.Caching.Abstractions.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
4+
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
55
<EnableDefaultItems>true</EnableDefaultItems>
6+
<!-- Use targeting pack references instead of granular ones in the project file. -->
7+
<DisableImplicitAssemblyReferences>false</DisableImplicitAssemblyReferences>
68
<PackageDescription>Caching abstractions for in-memory cache and distributed cache.
79

810
Commonly Used Types:
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
3+
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
44
</PropertyGroup>
5+
56
<ItemGroup>
67
<Compile Include="Microsoft.Extensions.Caching.Memory.cs" />
78
</ItemGroup>
9+
810
<ItemGroup>
911
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Caching.Abstractions\ref\Microsoft.Extensions.Caching.Abstractions.csproj" />
1012
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.DependencyInjection.Abstractions\ref\Microsoft.Extensions.DependencyInjection.Abstractions.csproj" />
1113
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Logging.Abstractions\ref\Microsoft.Extensions.Logging.Abstractions.csproj" />
1214
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Options\ref\Microsoft.Extensions.Options.csproj" />
1315
</ItemGroup>
16+
17+
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(TargetFramework)' != '$(NetCoreAppCurrent)'">
18+
<Reference Include="System.Runtime" />
19+
</ItemGroup>
1420
</Project>

src/libraries/Microsoft.Extensions.Caching.Memory/src/Microsoft.Extensions.Caching.Memory.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
4+
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
55
<EnableDefaultItems>true</EnableDefaultItems>
6+
<!-- Use targeting pack references instead of granular ones in the project file. -->
7+
<DisableImplicitAssemblyReferences>false</DisableImplicitAssemblyReferences>
68
<PackageDescription>In-memory cache implementation of Microsoft.Extensions.Caching.Memory.IMemoryCache.</PackageDescription>
79
</PropertyGroup>
810

src/libraries/Microsoft.Extensions.Configuration.Abstractions/ref/Microsoft.Extensions.Configuration.Abstractions.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@
33
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
44
<Nullable>enable</Nullable>
55
</PropertyGroup>
6+
67
<ItemGroup>
78
<Compile Include="Microsoft.Extensions.Configuration.Abstractions.cs" />
89
</ItemGroup>
10+
911
<ItemGroup>
1012
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Primitives\ref\Microsoft.Extensions.Primitives.csproj" />
1113
</ItemGroup>
1214

13-
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
14-
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.csproj" />
15-
</ItemGroup>
16-
1715
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(TargetFramework)' != '$(NetCoreAppCurrent)'">
1816
<Reference Include="System.Runtime" />
1917
</ItemGroup>

src/libraries/Microsoft.Extensions.Configuration.Binder/ref/Microsoft.Extensions.Configuration.Binder.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
44
<Nullable>enable</Nullable>
55
</PropertyGroup>
6+
67
<ItemGroup>
78
<Compile Include="Microsoft.Extensions.Configuration.Binder.cs" />
89
</ItemGroup>
10+
911
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
1012
<Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\DynamicallyAccessedMembersAttribute.cs" />
1113
<Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\DynamicallyAccessedMemberTypes.cs" />
@@ -16,10 +18,6 @@
1618
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Configuration.Abstractions\ref\Microsoft.Extensions.Configuration.Abstractions.csproj" />
1719
</ItemGroup>
1820

19-
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
20-
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.csproj" />
21-
</ItemGroup>
22-
2321
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(TargetFramework)' != '$(NetCoreAppCurrent)'">
2422
<Reference Include="System.Runtime" />
2523
</ItemGroup>

src/libraries/Microsoft.Extensions.Configuration.CommandLine/ref/Microsoft.Extensions.Configuration.CommandLine.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Configuration.Abstractions\ref\Microsoft.Extensions.Configuration.Abstractions.csproj" />
1111
</ItemGroup>
1212

13-
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
14-
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.csproj" />
15-
</ItemGroup>
16-
1713
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(TargetFramework)' != '$(NetCoreAppCurrent)'">
1814
<Reference Include="System.Runtime" />
1915
</ItemGroup>

src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/ref/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Configuration.Abstractions\ref\Microsoft.Extensions.Configuration.Abstractions.csproj" />
1111
</ItemGroup>
1212

13-
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
14-
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.csproj" />
15-
</ItemGroup>
16-
1713
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(TargetFramework)' != '$(NetCoreAppCurrent)'">
1814
<Reference Include="System.Runtime" />
1915
</ItemGroup>

0 commit comments

Comments
 (0)