Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Adding .NET Framework configurations to OOB packages so that they won't require the netstandard shims when targeting .NET Framework #42901

Merged
merged 8 commits into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions pkg/Microsoft.Private.PackageBaseline/packageIndex.json
Original file line number Diff line number Diff line change
Expand Up @@ -764,9 +764,10 @@
"4.0.0",
"4.3.0",
"4.4.0",
"4.5.0"
"4.5.0",
"4.5.1"
],
"BaselineVersion": "4.5.0",
"BaselineVersion": "4.5.1",
"InboxOn": {
"netcoreapp2.0": "4.0.2.0",
"netcoreapp2.1": "4.0.3.0",
Expand Down Expand Up @@ -891,7 +892,7 @@
"1.6.0",
"1.7.0"
],
"BaselineVersion": "1.7.0",
"BaselineVersion": "1.7.1",
"InboxOn": {
"netcoreapp2.0": "1.2.2.0",
"netcoreapp2.1": "1.2.3.0",
Expand Down Expand Up @@ -1217,7 +1218,7 @@
"1.3.0",
"1.4.0"
],
"BaselineVersion": "1.4.0",
"BaselineVersion": "1.4.1",
"InboxOn": {},
"AssemblyVersionInPackageVersion": {
"1.0.31.0": "1.0.31",
Expand Down Expand Up @@ -1253,7 +1254,7 @@
"1.3.0",
"1.4.0"
],
"BaselineVersion": "1.4.0",
"BaselineVersion": "1.4.1",
"InboxOn": {},
"AssemblyVersionInPackageVersion": {
"1.0.31.0": "1.0.31",
Expand All @@ -1271,7 +1272,7 @@
"1.3.0",
"1.4.0"
],
"BaselineVersion": "1.4.0",
"BaselineVersion": "1.4.1",
"InboxOn": {},
"AssemblyVersionInPackageVersion": {
"1.0.31.0": "1.0.31",
Expand Down Expand Up @@ -2870,9 +2871,10 @@
"4.5.0",
"4.5.1",
"4.5.2",
"4.5.3"
"4.5.3",
"4.5.4"
],
"BaselineVersion": "4.5.3",
"BaselineVersion": "4.5.4",
"InboxOn": {
"netcoreapp2.1": "4.1.0.0",
"netcoreapp3.0": "4.2.0.0",
Expand Down Expand Up @@ -3894,7 +3896,7 @@
"1.7.0",
"1.8.0"
],
"BaselineVersion": "1.8.0",
"BaselineVersion": "1.8.1",
"InboxOn": {
"netcoreapp2.0": "1.4.2.0",
"netcoreapp2.1": "1.4.3.0",
Expand Down Expand Up @@ -4191,7 +4193,7 @@
"4.7.0",
"4.7.1"
],
"BaselineVersion": "4.7.0",
"BaselineVersion": "4.7.1",
"InboxOn": {
"netcoreapp3.0": "4.0.5.0",
"netcoreapp3.1": "4.0.6.0",
Expand Down Expand Up @@ -5512,7 +5514,7 @@
"4.6.0",
"4.7.0"
],
"BaselineVersion": "4.7.0",
"BaselineVersion": "4.7.1",
"InboxOn": {
"netcoreapp3.0": "4.0.4.0",
"netcoreapp3.1": "4.0.5.0",
Expand Down Expand Up @@ -5786,9 +5788,10 @@
"4.5.0",
"4.5.1",
"4.5.2",
"4.5.3"
"4.5.3",
"4.5.4"
],
"BaselineVersion": "4.5.2",
"BaselineVersion": "4.5.4",
"InboxOn": {
"netcoreapp2.0": "4.1.1.0",
"netcoreapp2.1": "4.3.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<!-- This package is special because it uses targets to include assemblies to referencePath, so
it will still require the netstandard facades. -->
<DisableVerifyNotDependsOnNetStandardTest>true</DisableVerifyNotDependsOnNetStandardTest>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<!-- This package is special because it uses targets to include assemblies to referencePath, so
it will still require the netstandard facades. -->
<DisableVerifyNotDependsOnNetStandardTest>true</DisableVerifyNotDependsOnNetStandardTest>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<!-- This package is special because it uses targets to include assemblies to referencePath, so
it will still require the netstandard facades. -->
<DisableVerifyNotDependsOnNetStandardTest>true</DisableVerifyNotDependsOnNetStandardTest>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<!-- This package is special because it uses targets to include assemblies to referencePath, so
it will still require the netstandard facades. -->
<DisableVerifyNotDependsOnNetStandardTest>true</DisableVerifyNotDependsOnNetStandardTest>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<!-- This package is special because it uses targets to include assemblies to referencePath, so
it will still require the netstandard facades. -->
<DisableVerifyNotDependsOnNetStandardTest>true</DisableVerifyNotDependsOnNetStandardTest>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<!-- This package is special because it uses targets to include assemblies to referencePath, so
it will still require the netstandard facades. -->
<DisableVerifyNotDependsOnNetStandardTest>true</DisableVerifyNotDependsOnNetStandardTest>
</PropertyGroup>
</Project>
7 changes: 7 additions & 0 deletions pkg/test/packageTest.targets
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,16 @@
IgnoredTypes="@(IgnoredTypes)" />
</Target>

<Target Name="VerifyNotDependsOnNetStandard"
DependsOnTargets="ResolveReferences"
Condition="'$(_ShortFrameworkIdentifier)' == 'net' AND '$(_TargetFrameworkVersionWithoutV)' &gt;= '4.6.1' AND '$(RuntimeIdentifier)' == '' AND '$(DisableVerifyNotDependsOnNetStandardTest)' != 'true'">
<Error Condition="'$(DependsOnNetStandard)' == 'true'" Text="Package $(TestPackageId) requires netstandard shims when targeting $(TargetFramework)" />
</Target>

<PropertyGroup>
<_testDependsOn>
LogBeginTest;
VerifyNotDependsOnNetStandard;
VerifyReferenceClosure;
VerifyReferenceTypes;
VerifyRuntimeClosure;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal PinnedBufferMemoryStream(byte[] array)
Initialize(ptr, len, len, FileAccess.Read);
}

#if !netstandard
#if (!netstandard && !netfx)
public override int Read(Span<byte> buffer) => ReadCore(buffer);

public override void Write(ReadOnlySpan<byte> buffer) => WriteCore(buffer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ internal RuntimeResourceSet(Stream stream, bool permitDeserialization = false) :
Reader = _defaultReader;
}
#else
private IResourceReader Reader => _defaultReader!;
private
#if netfx
new
#endif
IResourceReader Reader => _defaultReader!;

internal RuntimeResourceSet(IResourceReader reader) :
// explicitly do not call IResourceReader constructor since it caches all resources
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Bcl.AsyncInterfaces/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<PackageVersion>1.1.0</PackageVersion>
<PackageVersion>1.1.1</PackageVersion>
<StrongNameKeyId>Open</StrongNameKeyId>
<!-- This assembly should never be placed inbox as it is only for downlevel compatibility. -->
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<PackageVersion>2.2.0</PackageVersion>
<PackageVersion>2.2.1</PackageVersion>
<SkipValidatePackage>true</SkipValidatePackage>
<AssemblyVersion>2.0.1.0</AssemblyVersion>
<AssemblyFileVersion>$(AssemblyVersion)</AssemblyFileVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<Project>
<PropertyGroup>
<BuildConfigurations>
<PackageConfigurations>
netstandard;
net461;
</PackageConfigurations>
<BuildConfigurations>
$(PackageConfigurations);
netfx;
</BuildConfigurations>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@
<StringResourcesPath>..\..\System.Private.Xml\src\Resources\Strings.resx</StringResourcesPath>
<StringResourcesName>FxResources.$(AssemblyName.Replace('-', '_')).SR</StringResourcesName>
<OutputType>Exe</OutputType>
<Configurations>netstandard-Debug;netstandard-Release</Configurations>
<Configurations>netstandard-Debug;netstandard-Release;net461-Debug;net461-Release;netfx-Debug;netfx-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="Sgen.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsNetFx)' == 'true'">
<Reference Include="mscorlib" />
<Reference Include="System.Xml" />
<Reference Include="System" />
</ItemGroup>
<Import Project=".\GenerateThisAssemblyCs.targets" />
</Project>
2 changes: 1 addition & 1 deletion src/System.Collections.Immutable/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<PackageVersion>1.7.0</PackageVersion>
<PackageVersion>1.7.1</PackageVersion>
<AssemblyVersion>1.2.5.0</AssemblyVersion>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
Expand Down
2 changes: 2 additions & 0 deletions src/System.Collections.Immutable/ref/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
netstandard1.0;
netstandard1.3;
netstandard;
net461;
</PackageConfigurations>
<BuildConfigurations>
$(PackageConfigurations);
netcoreapp;
netfx;
uap-Windows_NT;
</BuildConfigurations>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{C7EFF4EE-70DC-453B-B817-4AF67921AB03}</ProjectGuid>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;netstandard1.0-Debug;netstandard1.0-Release;netstandard1.3-Debug;netstandard1.3-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;netstandard1.0-Debug;netstandard1.0-Release;netstandard1.3-Debug;netstandard1.3-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release;net461-Debug;net461-Release;netfx-Debug;netfx-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="System.Collections.Immutable.cs" />
Expand All @@ -23,4 +23,10 @@
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard1.3' or '$(TargetGroup)' == 'netstandard'">
<Reference Include="System.Memory" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsNetFx)' == 'true'">
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Memory" />
<Reference Include="netstandard" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions src/System.Collections.Immutable/src/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
netstandard1.0;
netstandard1.3;
netstandard;
net461;
</PackageConfigurations>
<BuildConfigurations>
$(PackageConfigurations);
netfx;
netcoreapp;
uap-Windows_NT;
</BuildConfigurations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<FileAlignment>512</FileAlignment>
<GenerateAppxPackageOnBuild>False</GenerateAppxPackageOnBuild>
<PackageTargetFramework Condition="'$(TargetGroup)' == 'netstandard1.0'">netstandard1.0;portable-net45+win8+wp8+wpa81</PackageTargetFramework>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;netstandard1.0-Debug;netstandard1.0-Release;netstandard1.3-Debug;netstandard1.3-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;netstandard1.0-Debug;netstandard1.0-Release;netstandard1.3-Debug;netstandard1.3-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release;net461-Debug;net461-Release;netfx-Debug;netfx-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="Properties\InternalsVisibleTo.cs" />
Expand Down Expand Up @@ -114,4 +114,11 @@
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard1.3' or '$(TargetGroup)' == 'netstandard'">
<Reference Include="System.Memory" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsNetFx)' == 'true'">
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Memory" />
<Reference Include="netstandard" />
<Reference Include="System.Core" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<BuildConfigurations>
netstandard;
_netfx;
_net461;
</BuildConfigurations>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<Project>
<PropertyGroup>
<BuildConfigurations>
<PackageConfigurations>
netstandard;
net461;
</PackageConfigurations>
<BuildConfigurations>
$(PackageConfigurations);
netfx;
</BuildConfigurations>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<ProjectGuid>{C6257381-C624-494A-A9D9-5586E60856EA}</ProjectGuid>
<AssemblyName>System.Composition.AttributedModel</AssemblyName>
<Configurations>netstandard-Debug;netstandard-Release</Configurations>
<Configurations>netstandard-Debug;netstandard-Release;net461-Debug;net461-Release;netfx-Debug;netfx-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="System\Composition\Convention\AttributedModelProvider.cs" />
Expand All @@ -19,4 +19,7 @@
<Compile Include="System\Composition\SharedAttribute.cs" />
<Compile Include="System\Composition\SharingBoundaryAttribute.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsNetFx)' == 'true'">
<Reference Include="mscorlib" />
</ItemGroup>
</Project>
7 changes: 6 additions & 1 deletion src/System.Composition.Convention/src/Configurations.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<Project>
<PropertyGroup>
<BuildConfigurations>
<PackageConfigurations>
netstandard;
net461;
</PackageConfigurations>
<BuildConfigurations>
$(PackageConfigurations);
netfx;
</BuildConfigurations>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<RootNamespace>
</RootNamespace>
<!-- CommonStrings needs RootNamespace to be empty -->
<Configurations>netstandard-Debug;netstandard-Release</Configurations>
<Configurations>netstandard-Debug;netstandard-Release;net461-Debug;net461-Release;netfx-Debug;netfx-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="System\Composition\Convention\ConventionBuilder.cs" />
Expand Down Expand Up @@ -36,4 +36,8 @@
<Name>System.Composition.AttributedModel</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetsNetFx)' == 'true'">
<Reference Include="mscorlib" />
<Reference Include="System.Core" />
</ItemGroup>
</Project>
Loading