[英]Visual Studio 2017 - Potentially unneeded dlls in release folder
i'm trying to obtain an executable file with only the necessary dlls in the release folder, unfortunately VS is putting in that folder even System dlls, that afaik are not supposed to be redistributed with the executable. 我正在尝试获取释放文件夹中仅包含必需dll的可执行文件,不幸的是VS甚至将dll放入该文件夹中,即afaik不应随可执行文件一起重新分发。 I'd like to know if there's a way to make VS add to the release folder only dlls the executable can not work without, the ones that are supposed to be redistributed.
我想知道是否有一种方法可以使VS将只有可执行文件无法运行的dll添加到发布文件夹中,而这些dll应该重新分发。
These assemblies are shims for .Net Standard where the full framework had gaps. 这些程序集是.Net标准的垫片,其中整个框架都有空白。 Based on the assemblies in that folder, I assume that your exe is targeting .net 4.6.x and you are consuming a .net standard library.
基于该文件夹中的程序集,我假设您的exe面向.net 4.6.x,并且您正在使用.net标准库。
If you upgrade to .net 4.7.2 you will see the number of required System.*
assemblies reduced greatly. 如果升级到.net 4.7.2,将看到所需的
System.*
程序集数量大大减少。
See this answer for more details: Why does my .NET Standard NuGet package trigger so many dependencies? 有关更多详细信息,请参见此答案: 为什么我的.NET Standard NuGet包会触发这么多的依赖关系?
I'm assuming this is a dotnet core project. 我假设这是一个dotnet核心项目。 Use the "dotnet publish" command to create your deployment files (the screenshot looks like a VS build directory?).
使用“ dotnet publish”命令创建部署文件(屏幕截图看起来像VS构建目录?)。 You might see more dlls than you're used too if you're coming to dotnet core from using the Windows frameworks previously, but it depends on the publish options you use.
如果您以前通过使用Windows框架进入dotnet核心,则可能会看到比以前更多的dll,但这取决于您使用的发布选项。
https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.