3

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'

Question

Why libman.json is created as 'Content' and why it has 'Copy if new' property? 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. 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)

g.pickardou
  • 32,346
  • 36
  • 123
  • 268

1 Answers1

1

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).

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.

Jimmy
  • 27,142
  • 5
  • 87
  • 100