简体   繁体   中英

.NET multi target frameworks copies System.* DLLs to .NET Framework output directory

I've got a .NET project that targets multiple frameworks, ie, <TargetFrameworks>netstandard2.1;net472</TargetFrameworks>

The project contains NuGet packages that bring in System.* dependencies like System.Memory and System.Buffers .

When I build the project it creates two output directories, netstandard2.1 and net472 , which is fine.

The bit I'm struggling to understand is why does the net472 output directory contain the System.* dependencies? I understand them being copied to the netstandard2.1 directory, but why are they copied for the .NET Framework directory when they can be loaded from the .NET Framework installation on the machine (ie, GAC)?

Is there a way to exclude System.* dlls when for the net472 target?

What you see is ok, as both are nuget packages that are not part of .net framework (yellow instead of green)

在此处输入图像描述

在此处输入图像描述

so they need to be copied to output.

Everything is fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM