繁体   English   中英

发布 WPF 应用程序因未授权而失败。NuGet 服务索引 (Azure DevOps)

[英]Publishing WPF application fails du to unauthorized .NuGet service index (Azure DevOps)

我想发布我的 WPF 应用程序之一(到文件夹)。
该应用程序需要我通过 Azure Devops 发布的一些 NuGet 包。 我使用我在 DevOps 中使用的完全相同的帐户登录 Visual Studio,因此通过“管理解决方案的包”安装/删除包没有问题。
构建和运行我的解决方案也没有问题。

但是当我想发布我的解决方案时,我收到了一条我不理解的未经授权的消息:

The plugin credential provider could not acquire credentials. Authentication may require manual action. Consider re-running the command with --interactive for `dotnet`, /p:NuGetInteractive="true" for MSBuild or removing the -NonInteractive switch for `NuGet`
4>Unable to load the service index for source https://pkgs.dev.azure.com/MyProjectName/_packaging/MyNuGetFeed/nuget/v3/index.json.

我可以在这里尝试什么? 为什么当我在本地构建和运行项目时 VS 在访问提要时没有问题,但发布是一个问题?

欢迎任何建议

更新:

仅当我选择“独立”选项时才会发生这种情况。 如果我使用“独立于框架”发布,它可以毫无问题地工作。

我在 Teamcity 上遇到了类似的错误:

当我想发布我的 wpf 应用程序时,(在网站上,使用 clickonce ...)

插件凭据提供程序无法获取凭据。 身份验证可能需要手动操作。 考虑为 do.net 使用 --interactive 重新运行命令,为do.net使用 /p:NuGetInteractive="true" 或为NuGet删除 -NonInteractive 开关

灵感来自在此处输入图像描述 你的评论,我试图切换到独立的(在寻找独立于框架的;-)选项之后)并得到了这个信息:

Found conflicts between different versions of "System.Drawing.Common" that could not be resolved.
6>There was a conflict between 
  "System.Drawing.Common, Version=4.0.0.0, Culture=neutral, and 
  "System.Drawing.Common, Version=5.0.0.0, Culture=neutral, 
6>"System.Drawing.Common, Version=4.0.0.0, Culture=neutral, was chosen because it was primary and 
  "System.Drawing.Common, Version=5.0.0.0, Culture=neutral, was not.

啊,使用了底层 .NET 的不同版本……!

6> References which depend on 
   "System.Drawing.Common, Version=4.0.0.0, Culture=neutral, 
     [...nuget\packages\system.drawing.common\4.5.0\ref\netstandard2.0\System.Drawing.Common.dll].
6>    ...nuget\packages\system.drawing.common\4.5.0\ref\netstandard2.0\System.Drawing.Common.dll
6> Project file item includes which caused reference 
     "...nuget\packages\system.drawing.common\4.5.0\ref\netstandard2.0\System.Drawing.Common.dll".
6>    ...nuget\packages\system.drawing.common\4.5.0\ref\netstandard2.0\System.Drawing.Common.dll

6> References which depend on 
"System.Drawing.Common, Version=5.0.0.0, Culture=neutral, 
     [].
6>  ...Release\net5.0-windows\xyz.dll
6> Project file item includes which caused reference 
   "...Release\net5.0-windows\xyz.dll".
6>  ...Release\net5.0-windows\xyz.dll

xyz 项目或其依赖的 nugets 之一导致了问题;-)(即在不同版本中使用 .net)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM