为什么要使用".deps.json"发布文件夹上的文件和发布输出文件夹的大小是不同的 [英] Why the ".deps.json" file on release folder and publish output folder size are difference

查看:51
本文介绍了为什么要使用".deps.json"发布文件夹上的文件和发布输出文件夹的大小是不同的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立在项目上,并检查发行文件夹的大小为"280KB" 但是当我尝试发布输出文件时,文件大小为"296KB"

I build on project and checked on release folder size is "280KB" but when I try on publish output file size is "296KB"

在.net core 2.0和VS 2017上进行了测试

推荐答案

bin/[Configuration]中的输出仅用于本地开发.该文件与runtimeconfig.dev.json一起指定生成输出的依赖项关闭,并从本地NuGet包缓存中解析引用.如果将构建输出复制到另一台计算机/用户,它将无法正常工作.

The output in bin/[Configuration] is only meant to be used for local development. Together with the runtimeconfig.dev.json this file specifies the dependency closure of your build output and references are resolved from your local NuGet package cache. If you copy the build output to another machine/user, it will not work.

对于部署,将所有需要的DLL复制到构建输出,并使用稍有不同的输入来生成deps.json文件,以描述已发布应用程序的依赖关系关闭.

For deployment, all needed DLLs are copied to the build output and a deps.json file is generated using a slightly different input to describe the dependency closure of the published application.

此发布输出是通过Visual Studio发布输出或通过使用

This publish output is generated by either Visual Studio publish output or by using

dotnet publish -c Release

在控制台中.

这篇关于为什么要使用".deps.json"发布文件夹上的文件和发布输出文件夹的大小是不同的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆