* Add a target for netstandard2.0
Adding netstandard2.0 TFMs to the PlatformAbstractions and DependencyModel libraries so we don't force users to bring down unnecessary dependencies.
Fix dotnet/core-setup#3680
* Add a comment explaining the Newtonsoft.Json versioning reasoning.
Commit migrated from https://github.com/dotnet/core-setup/commit/
2c99636fa3b1d38c773a18b8d325c865c1804629
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<AssemblyFileVersion>$(VersionPrefix)</AssemblyFileVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<IncludeSymbols>true</IncludeSymbols>
<Serviceable>true</Serviceable>
<PackageLicenseUrl>https://github.com/dotnet/core-setup/blob/master/LICENSE.TXT</PackageLicenseUrl>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFramework)' != 'netstandard2.0' ">
+ <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
+ </PropertyGroup>
+
<PropertyGroup>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>git://github.com/dotnet/core-setup</RepositoryUrl>
<PropertyGroup>
<Description>Abstractions for making code that uses file system and environment testable.</Description>
- <TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
- <TargetFrameworks Condition="'$(OS)' != 'Windows_NT'" >netstandard1.3</TargetFrameworks>
+ <TargetFrameworks>net45;netstandard1.3;netstandard2.0</TargetFrameworks>
+ <TargetFrameworks Condition="'$(OS)' != 'Windows_NT'" >netstandard1.3;netstandard2.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PackageReference Include="System.Runtime.Extensions" Version="4.1.0" />
<PackageReference Include="System.Runtime.InteropServices" Version="4.1.0" />
</ItemGroup>
- <ItemGroup>
+ <ItemGroup Condition=" '$(TargetFramework)' != 'netstandard2.0' ">
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.0.0" />
</ItemGroup>
-
-
</Project>
<PropertyGroup>
<Description>Abstractions for reading `.deps` files.</Description>
- <TargetFrameworks>net451;netstandard1.3;netstandard1.6</TargetFrameworks>
- <TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netstandard1.3;netstandard1.6</TargetFrameworks>
+ <TargetFrameworks>net451;netstandard1.3;netstandard1.6;netstandard2.0</TargetFrameworks>
+ <TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netstandard1.3;netstandard1.6;netstandard2.0</TargetFrameworks>
</PropertyGroup>
+ <Choose>
+ <!--
+ Newtonsoft.Json v11.0.1 is the first verison that targets netstandard2.0. Since we added a target for netstandard2.0
+ so users aren't forced to download the 1.x dependencies, it makes sense to use this version of Newtonsoft.Json.
+ However, we still use the previous (v9.0.1) for other TFMs, so existing users don't need to upgrade their Newtonsoft.Json.
+ For example, the SDK targets net4x and is loaded in VS, so it can't upgrade to a new Newtonsoft.Json.
+ -->
+ <When Condition="'$(TargetFramework)' == 'netstandard2.0'">
+ <PropertyGroup>
+ <NewtonsoftJsonPackageVersion>11.0.1</NewtonsoftJsonPackageVersion>
+ </PropertyGroup>
+ </When>
+ <Otherwise>
+ <PropertyGroup>
+ <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
+ </PropertyGroup>
+ </Otherwise>
+ </Choose>
+
<ItemGroup>
<ProjectReference Include="..\Microsoft.DotNet.PlatformAbstractions\Microsoft.DotNet.PlatformAbstractions.csproj" />
- <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
+ <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' Or '$(TargetFramework)' == 'netstandard1.6' ">
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="Moq" Version="4.7.142" />
- <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="NuGet.Versioning" Version="4.0.0" />
<PackageReference Include="Microsoft.DotNet.ProjectModel" Version="1.0.0-rc2-002702" />
<ProjectReference Include="..\..\managed\Microsoft.DotNet.PlatformAbstractions\Microsoft.DotNet.PlatformAbstractions.csproj" />