部署 .Net Core 2.0 应用程序包括 150 多个 Dll

我最近将 Visual Studio 版本从 2017 年更新到 2019 年,还安装了 .net core 版本 2.2。我有 .Net Core 2.0 Web 项目,其中仅包含通过 Nugget 打包系统添加的 dll,如下所示;

https://img.mukewang.com/65057c0c000127c406130495.jpg

此文件夹仅包含 22 项。

但是在 VS 更新之后,当我发布应用程序时,我有一个输出文件夹,如下所示:

https://img2.mukewang.com/65057c1800019f7506230906.jpg

该文件夹包含近 200 个 dll。我什至没有更改发布设置。我没有任何这些依赖项,并且我确保部署方法不是self-contained deployment但是Framework-dependent Deployment

我正在使用 CLI 命令来发布我的应用程序;

dotnet 发布 -c 发布

我的已发布文件夹中有这么多 dll 的原因是什么?



慕哥6287543
浏览 56回答 1
1回答

ITMISS

对我来说,我不久前必须将此部分添加到 .csproj 文件中,特别是 PublishWithAspNetCoreTargetManifest  <PropertyGroup>    <TargetFramework>netcoreapp2.2</TargetFramework>    <Platforms>AnyCPU;x64</Platforms>    <PublishWithAspNetCoreTargetManifest>true</PublishWithAspNetCoreTargetManifest>  </PropertyGroup>
打开App,查看更多内容
随时随地看视频慕课网APP