是否应该将作为 Nuget 开发的 dll 放在单独的存储库中供公司内部使用?

Should dll developed as Nuget be placed in separate repository for internal company use?

我正在开发一个 ASP.Net 核心 Web Api 以及特定于域的 dll。我还开发了一个 dll,结果证明它可以作为 NuGet dll 跨组织共享。我在拥有我的 AspNet Core 应用程序的同一解决方案中创建了该 dll。因此,每次我 运行 构建时,即使未对该 dll 进行任何更改,此 Nuget 的版本也会被破坏。

我有两个问题:

  1. 我应该将这个 Nuget dll 移动到单独的存储库吗?这是最佳做法吗?
  2. 我能否以某种方式在 AzureDevops 管道中配置一个任务,使其版本仅在对该 dll 进行更改时才会升级?
  1. Should I move this Nuget dll to separate repository? Is this a best practice?

这取决于您的实际应用。如果解决方案中这个NuGet dll的项目是独立的,与其他项目无关。最佳做法是将此 Nuget dll 移动到单独的存储库。

这有助于管理共享的 nuget dll。

  1. Can i somehow configure a task in AzureDevops pipeline in a way that version should be bumped only when there is a change made to that dll?

AFAIK,没有这样的任务来实现这个。但是我们可以尝试修改当前的管道以仅构建 AspNet Core 应用程序项目 而不是 解决方案 ,并创建一个仅构建 nuget dll 的新管道项目并提供路径过滤器:

在这种情况下,每次 运行 构建时,此 Nuget 的版本都会被破坏,仅对该 nuget dll 项目进行了更改。