ASP.NET Core发布会在已发布的文件夹中生成许多DLL,为什么?

编程入门 行业动态 更新时间:2024-10-20 11:55:43
本文介绍了ASP.NET Core发布会在已发布的文件夹中生成许多DLL,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用.NET Core Framework在Visual Studio 2015中创建了一个简单的Web API项目.当我使用默认设置发布此项目时,它会创建以下内容:

I created a simple Web API project in Visual Studio 2015 using the .NET Core Framework. When I publish this project using the default settings, it creates the following:

总共有 155个DLL ,在PublishOutput根目录中有77个,在refs文件夹中有78个.

In total there are 155 DLLs, 77 in the PublishOutput root and 78 in the refs folder.

  • 为什么将所有DLL放在publish文件夹中?不能只是从单个共享中引用安装它们的DLL位置?
推荐答案

与以前的框架版本相比,Dotnet内核的规模往往非常小.

Dotnet core tend to be very minimal as opposed to the previous versions of framework.

在dotnet核心中,主要目的是使核心框架尽可能小,如果需要更多内容,请通过NuGet软件包将其引入.

In dotnet core, the main purpose was making the core framework as small as possible and if you need more stuff, bring it in through NuGet packages.

因此,许多以前在框架中可用的依赖项现在都移到了NuGet包中,并且您知道NuGet包中有一连串的依赖项,因此我们最终在发布输出中将拥有许多库,很好.

So, many dependencies that used to be available in the framework are now moved to the NuGet packages and as you know there is a chain of dependencies in NuGet packages, so we will end up with so many libraries in our publish output, which is fine.

另一点是,在大多数情况下,我们使用的项目模板具有过多的依赖关系,而这些依赖关系可能根本不需要.因此,我们可以从一个非常小的模板开始,然后在其中添加所需的内容,或者从更笨拙的模板中删除无用的内容.

Another point being, most of the time, we're using project templates with too many dependencies that might not be needed whatsoever. So we can either start with a very minimal template and add needed stuff in it, or remove useless stuff from a more chuncky template.

更多推荐

ASP.NET Core发布会在已发布的文件夹中生成许多DLL,为什么?

本文发布于:2023-11-07 11:02:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566276.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:会在   文件   夹中   NET   ASP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!