Skip to content

Commit

Permalink
Remove unnecessary NuGet package references (dotnet#5242)
Browse files Browse the repository at this point in the history
Some NuGet packages (such as `System.Net.Http`) do not target .NET Standard 2.0 and reference tons of packages from older .NET Standard versions. The types they contain are already included in .NET Standard 2.0, so they were removed to unburden the package reference graph.
  • Loading branch information
teo-tsirpanis authored and sfoslund committed May 15, 2020
1 parent c86960d commit 8aef9dd
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion eng/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</ItemGroup>

<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
<GlobalPackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-alpha-004" PrivateAssets="All"/>
<GlobalPackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 2 additions & 5 deletions src/Build/Microsoft.Build.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\Shared\FileSystemSources.proj" />
<Import Project="..\Shared\DebuggingSources.proj" />
Expand Down Expand Up @@ -45,11 +45,8 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">
<PackageReference Include="System.Diagnostics.TraceSource" />
<PackageReference Include="System.Reflection.Metadata" />
<PackageReference Include="System.Reflection.TypeExtensions" />
<PackageReference Include="System.Runtime.Loader" />
<PackageReference Include="System.Security.Principal.Windows" Condition="'$(TargetFramework)' == 'netcoreapp2.1'" />
<PackageReference Include="System.Security.Principal.Windows" />
<PackageReference Include="System.Text.Encoding.CodePages" />
<!-- Need Win32 API on .NET Core to ping registry to determine long path support -->
<PackageReference Include="Microsoft.Win32.Registry" />
Expand Down
2 changes: 0 additions & 2 deletions src/Framework/Microsoft.Build.Framework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Runtime.Serialization.Primitives" Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'" />
<PackageReference Include="System.Security.Permissions" Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'" />
<PackageReference Include="System.Threading.Thread" Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'" />
<Reference Include="System.Xaml" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Samples/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-alpha-004" PrivateAssets="all"/>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="all"/>
<PackageReference Include="Microsoft.VisualStudio.SDK.EmbedInteropTypes" Version="15.0.15" PrivateAssets="All" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'" />
</ItemGroup>

Expand Down
3 changes: 0 additions & 3 deletions src/Tasks/Microsoft.Build.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -987,11 +987,8 @@

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">
<PackageReference Include="System.CodeDom" />
<PackageReference Include="System.Linq.Parallel" />
<PackageReference Include="System.Net.Http" />
<PackageReference Include="System.Reflection.Metadata" />
<PackageReference Include="System.Reflection.TypeExtensions" />
<PackageReference Include="System.Resources.Writer" />
<PackageReference Include="System.Security.Permissions" />
<PackageReference Include="System.Threading.Tasks.Dataflow" />

Expand Down

0 comments on commit 8aef9dd

Please sign in to comment.