【问题标题】:Error while running dotnet restore Microsoft.VisualStudio.Azure.Fabric.Application.props not found运行 dotnet restore 时出错 Microsoft.VisualStudio.Azure.Fabric.Application.props not found
【发布时间】:2019-05-14 21:44:40
【问题描述】:

当我们运行 dotnet restore 时

C:\Program Files\dotnet\dotnet.exe" restore C:\agent\vsts-agent-win7-x64-2.119.1\vstswrk\58\s\My.Project.sln --configfile C:\agent\vsts-agent-win7-x64-2.119.1\vstswrk\58\Nuget\tempNuGet_3682.config --verbosity Detailed

"C:\agent\vsts-agent-win7-x64-2.119.1\vstswrk\58\s\My.Project.sln" (恢复目标) (1) -> "C:\agent\vsts-agent-win7-x64-2.119.1\vstswrk\58\s\My.Project\My.Project.sfproj" (_IsProjectRestoreSupported 目标) (2) -> (ValidateMSBuildFiles 目标)-> C:\agent\vsts-agent-win7-x64-2.119.1\vstswrk\58\s\My.Project\My.Project.sfproj(49,5): 错误:找不到 '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' 文件。请恢复“Microsoft.VisualStudio.Azure.Fabric.MSBuild” Nuget 包。

但是当我使用 nuget restore 恢复时,我能够恢复

C:\agent\vsts-agent-win7-x64-2.119.1\vstswrk\_tool\NuGet\4.4.1\x64\nuget.exe restore C:\agent\vsts-agent-win7-x64-2.119.1\vstswrk\58\s\My.Project.sln -Verbosity Detailed -NonInteractive -ConfigFile C:\agent\vsts-agent-win7-x64-2.119.1\vstswrk\58\Nuget\tempNuGet_3675.config

【问题讨论】:

  • 是.core项目吗?
  • 是的,它是 .net 核心项目服务结构

标签: azure-devops nuget


【解决方案1】:

服务结构项目本身(具有所有配置文件并打包服务)使用packages.config 获取构建工具。 dotnet restore 不支持packages.config,因此您必须使用nuget restore

Service Fabric 团队确实计划将 sfproj 移动到 SDK 样式的项目中,但在撰写本文时,在 SDK 样式项目中 Visual Studio 中存在一些问题,其中 SDK 来自 NuGet 包需要解决,以免给客户带来不好的VS体验。一旦可用并且您将 sfproj 迁移到 sdk 样式,那么 dotnet restore 应该可以工作,但在此之前您需要在 CI 管道中使用 nuget restore

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-11-25
    • 1970-01-01
    • 1970-01-01
    • 2018-07-03
    • 1970-01-01
    • 2022-07-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多