简体   繁体   English

Visual Studio 2017-发行文件夹中可能不需要的dll

[英]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应该重新分发。

Thank you. 谢谢。 Release folder: 发布文件夹: 释放文件夹

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.

相关问题 如何在Visual Studio 2017解决方案中设置文件夹以在其中搜索DLL? - How to set folder in a visual studio 2017 solution for searching DLLs there? 在Visual Studio 2017 Professional中使用发布设置进行构建 - Build with the Release settings In Visual Studio 2017 Professional Visual Studio Web部署在发布发布期间删除dll - Visual studio web deploy deleting dlls during release publish Visual Studio 2017 禁用文件夹命名空间 - Visual Studio 2017 disable folder namespace 在 Visual Studio 中编译时如何将 DLL 保存在不同的文件夹中? - How to save DLLs in a different folder when compiling in Visual Studio? 是否可以在Visual Studio 2008中为具有相对路径的DLL设置共享文件夹? - Is it possible to setup a shared folder for DLLs with relative pathing in Visual Studio 2008? 在带有nuget包的Visual Studio中,是否可以在发布时更改.dlls文件夹? - In visual studio with nuget packages is it possible to change the .dlls folder when publishing? 是否可以在Visual Studio中更改引用(dll)默认生成文件夹? - Is possible to change references (dlls) default build folder in visual studio? Visual Studio 2017使用SQLite DB构建版本 - Visual Studio 2017 building a release using SQLite DB 无法编译UWP的发布版本-Visual Studio 2017 - Cannot compile Release build of UWP - Visual Studio 2017
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM