【发布时间】:2019-11-02 03:10:26
【问题描述】:
我有一个要推送到私人 nuget 提要的包。然后其他一些项目引用了这些包。一切都很好,除非我指定了一个通配符,它只在 vs 中有效,但显然在通过 azure devops 构建恢复时无效:
这行得通:
<PackageReference Include="MyLibPackage" Version="1.0.0.114" />
但我收到unable to find package 错误:
<PackageReference Include="MyLibPackage" Version="*" />
在 azure devops 中恢复任务运行的 dockerfile 的 sn-p:
# Install the Credential Provider to configure the access
RUN wget -qO- https://raw.githubusercontent.com/Microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh | bash
# Configure the environment variables
ENV NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED true
ENV VSS_NUGET_EXTERNAL_FEED_ENDPOINTS "{\"endpointCredentials\": [{\"endpoint\":\"$feed\", \"password\":\"$pat\"}]}"
WORKDIR /src
COPY ["MyProject/MyProject.csproj", "MyProject/"]
RUN dotnet restore -s "$feed" "MyProject/MyProject.csproj"
【问题讨论】:
-
当指定一个明确的包版本时,恢复在 docker build 中运行,但不是针对始终最新的版本范围?
-
@JoshGust 是的,这是正确的
-
使用通配符时这是完全构建失败吗?我知道 nuget 会并行检查所有源,但如果没有找到匹配的源,它只会失败。
-
@JoshGust 不幸的是,它找不到任何包。只有 1 个来源和一个私人图书馆,我只想要最新的。
-
1.*的范围是否会改变行为?
标签: docker .net-core azure-devops nuget