[英]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.