【问题标题】:Why are there Microsoft packages in my private Nuget Feed in DevOps Artifacts?为什么 DevOps Artifacts 中我的私有 Nuget 源中有 Microsoft 包?
【发布时间】:2019-02-19 11:48:27
【问题描述】:

这是我的构建管道

# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net

trigger:
- master

pool:
  vmImage: 'VS2017-Win2016'

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'
  Major: '2'
  Minor: '0'
  Patch: '0'

steps:
- task: NuGetToolInstaller@0

- task: NuGetCommand@2
  inputs:
    restoreSolution: '$(solution)'

- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

- task: VSTest@2
  inputs:
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

- task: NuGetCommand@2
  inputs:
    command: pack
    packagesToPack: '**/*.csproj'
    versioningScheme: byPrereleaseNumber
    majorVersion: '$(Major)'
    minorVersion: '$(Minor)'
    patchVersion: '$(Patch)'

- task: NuGetCommand@2
  displayName: 'NuGet push'
  inputs:
    command: push
    publishVstsFeed: 'MyCommonFeed'
    allowPackageConflicts: true

我惊讶地发现创建的提要包含来自 Nuget.org 的包 为什么?

【问题讨论】:

    标签: azure-devops nuget


    【解决方案1】:

    为什么在 DevOps Artifacts 中我的私有 Nuget Feed 中有 Microsoft 包?

    这是因为如果您在创建此提要时启用来自公共来源的包,则默认情况下您的私有 Nuget 提要将 nuget.org 设置为上游来源:

    然后进入Setting->Upstream source,你会发现列出了三个公共源:

    您可以使用 source 过滤器来选择包的来源。

    当我们从上游源下载任何包时,它会被缓存在 Artifacts 中,下次你会看到它。

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2020-03-16
      • 2020-01-11
      • 2020-04-22
      • 2019-09-24
      • 1970-01-01
      • 2022-10-05
      • 1970-01-01
      • 1970-01-01
      • 2020-01-30
      相关资源
      最近更新 更多