简体   繁体   English

为什么 libman.json 被创建为“内容”以及为什么它具有“如果较新则复制”属性?

[英]Why libman.json is created as 'Content' and why it has 'Copy if newer' property?

Context语境

When I use Add Client Side Library in VS it creates the libman.json file in the project with properties 'Content' and 'Copy if newer'当我在 VS 中使用添加客户端库时,它会在项目中创建libman.json文件,其属性为“内容”和“如果较新则复制”

Question问题

Why libman.json is created as 'Content' and why it has 'Copy if new' property?为什么 libman.json 被创建为“内容”以及为什么它具有“如果新则复制”属性? As far I understand both is obsolete because the only thing we must pay attention, that libman.json should be placed into the source control.据我了解,两者都已过时,因为我们必须注意的唯一一件事是libman.json应该放入源代码管理中。 What am I missing?我错过了什么?

(Noise, optional reading) (噪音,可选读数)

(btw in the scenario of multiple projects, there could be multiple libman.json files, so the Copy if newer property makes the build process override other libman.json with the last, and the Content property makes the publish process override other libman.json with the last (or fail in .NET 6, but please note this post not about how to workaround that) (顺便说一句,在多个项目的情况下,可能有多个libman.json文件,因此Copy if newer属性使构建过程覆盖其他libman.json与最后一个,并且Content属性使发布过程覆盖其他libman.json最后一个(或在 .NET 6 中失败,但请注意这篇文章不是关于如何解决这个问题的)

The simple answer (at least, in SDK-style .NET projects) is that it's coming from the SDK's file globbing patterns, most probably from the Razor SDK ( here ).简单的答案(至少在 SDK 风格的 .NET 项目中)是它来自 SDK 的文件通配模式,很可能来自 Razor SDK ( 这里

You'll get the same issue with any other file, such as a package.json file, including the same errors in the multiple-project scenario with duplicate file names.对于任何其他文件,您都会遇到相同的问题,例如 package.json 文件,包括具有重复文件名的多项目方案中的相同错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将我的Azure DevOps NPM Artifact提要用作libman.json中的提供者? - How do I use my Azure DevOps NPM Artifact feed as a provider in my libman.json? 为什么“如果更新则复制”在文件更新时不复制文件? - Why does “Copy if newer” not copy a file when the file is updated? 为什么不只在输出目录中的文件较旧时才用“更新时替换”进行复制? - Why Copy if newer replaces not only when a file in the output dir is older? 为什么我的参考的Copy Local属性被禁用? - Why is the Copy Local property for my reference disabled? 将内容资源设置为“如果较新”,如何移动内容资源? - How to move content resource when it is set to Copy if newer? AnkhSVN本地上的较新副本 - AnkhSVN Newer Copy on Local msbuild PostBuildEvents复制(如果较新) - msbuild PostBuildEvents copy if newer 为什么要创建 function CreateWebHostBuilder()? - Why is function CreateWebHostBuilder() created? 为什么由发布程序创建的Setupper无法将文件复制到c:/ PROGRAM FILES - Why Setupper created by Publish feature does not copy files to c:/PROGRAM FILES 从“始终复制”切换到“复制如果更新”的风险 - Risks in switching from 'Copy always' to 'Copy if newer'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM