繁体   English   中英

Azure Service Fabric无法使用ASP.NET Core在VSTS上执行CI

[英]Azure Service Fabric unable to do CI on VSTS with ASP.NET Core

我创建了基于Service Fabric的系统,并在生产环境(和开发)中工作。 一切都好。 现在,我正在尝试使用提供的ASF项目模板在Visual Studio Team Services上设置CI。 不幸的是,我的系统具有基于ASP.NET Core 1.1的Actors(.NET 4.5.2)和WebAPI。 我已经引用了Actor接口项目(也是.NET 4.5.2)forom .NET Core。

当我尝试使用默认模板构建项目时,由于未运行dotnet restore,因此收到错误消息。 好的,所以我添加了运行dotnet restore的步骤,但随后却收到错误消息,抱怨它找不到对Actor.Interfaces的引用。

在我的开发机上,dotnet恢复也失败,但是用VS构建解决方案可以。

如何解决此问题?

[UPDATE]

谢谢Mardoxx,我已经取得了一些进步...现在,我在* .sln buld的错误提示之下。 我的解决方案是VS2015(在构建任务中设置),我已将env设置为Hosted VS2017。

IntegrationApi\IntegrationApi.xproj(7,11): Error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\DotNet\Microsoft.DotNet.Props" was not found. Also, tried to find "DotNet\Microsoft.DotNet.Props" in the fallback search path(s) for $(VSToolsPath) - "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0" . These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\amd64\msbuild.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.
Project "d:\a\1\s\Labelcall.sln" (1) is building "d:\a\1\s\IntegrationApi\IntegrationApi.xproj" (18) on node 1 (default targets).
d:\a\1\s\IntegrationApi\IntegrationApi.xproj(7,11): error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\DotNet\Microsoft.DotNet.Props" was not found. Also, tried to find "DotNet\Microsoft.DotNet.Props" in the fallback search path(s) for $(VSToolsPath) - "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0" . These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\amd64\msbuild.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.
Done Building Project "d:\a\1\s\IntegrationApi\IntegrationApi.xproj" (default targets) -- FAILED.

[UPDATE2]

采取starain-MSFT提出的步骤后,在“ dotnet恢复”期间出现错误:

log  : Restoring packages for d:\a\1\s\AdminPanel\project.json...
error: Unable to resolve 'AccountActor.Interfaces' for 
'.NETFramework,Version=v4.5.2'.
error: Unable to resolve 'CommonContracts' for 
'.NETFramework,Version=v4.5.2'.
error: Unable to resolve 'CommonInfrastructure' for 
'.NETFramework,Version=v4.5.2'.

[UPDATE3]

@starain输入后的另一个更新。

现在,我收到错误消息,找不到引用(来自Core项目的.NET 4.5.2项目)。

        Project "d:\a\1\s\LabelcallApplication\LabelcallApplication.sfproj" (2) is building "d:\a\1\s\MobileApi\MobileApi.xproj" (19) on node 1 (default targets).
    PrepareForBuild:
      Creating directory ".\bin\".
      Creating directory ".\obj\Release\".
    PreComputeCompileTypeScript:
      C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.0\tsc.exe  --noEmitOnError --listEmittedFiles
    CompileTypeScript:
      C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.0\tsc.exe  --noEmitOnError --listEmittedFiles
    CoreCompile:
      C:\Program Files\dotnet\dotnet.exe build "d:\a\1\s\MobileApi" --configuration Release --no-dependencies
      Project MobileApi (.NETFramework,Version=v4.5.2) will be compiled because expected outputs are missing
      Compiling MobileApi for .NETFramework,Version=v4.5.2
      C:\Program Files\dotnet\dotnet.exe compile-csc @d:\a\1\s\MobileApi\obj\Release\net452\dotnet-compile.rsp returned Exit Code 1
    MobileApi\project.json(6,44): Warning NU1012: Dependency conflict. Microsoft.ApplicationInsights.DependencyCollector 2.2.0 expected Microsoft.ApplicationInsights 2.2.0 but received 2.3.0
    d:\a\1\s\MobileApi\project.json(6,44): warning NU1012: Dependency conflict. Microsoft.ApplicationInsights.DependencyCollector 2.2.0 expected Microsoft.ApplicationInsights 2.2.0 but received 2.3.0 [d:\a\1\s\MobileApi\MobileApi.xproj]
    MobileApi\project.json(6,44): Warning NU1012: Dependency conflict. Microsoft.ApplicationInsights.PerfCounterCollector 2.2.0 expected Microsoft.ApplicationInsights 2.2.0 but received 2.3.0
    d:\a\1\s\MobileApi\project.json(6,44): warning NU1012: Dependency conflict. Microsoft.ApplicationInsights.PerfCounterCollector 2.2.0 expected Microsoft.ApplicationInsights 2.2.0 but received 2.3.0 [d:\a\1\s\MobileApi\MobileApi.xproj]
    MobileApi\project.json(6,44): Warning NU1012: Dependency conflict. Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel 2.2.0 expected Microsoft.ApplicationInsights 2.2.0 but received 2.3.0
    d:\a\1\s\MobileApi\project.json(6,44): warning NU1012: Dependency conflict. Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel 2.2.0 expected Microsoft.ApplicationInsights 2.2.0 but received 2.3.0 [d:\a\1\s\MobileApi\MobileApi.xproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): Error : d:\a\1\s\MobileApi\error CS0006: Metadata file 'd:\a\1\s\ContactActor.Interfaces\bin\Release\ContactActor.Interfaces.dll' could not be found
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : d:\a\1\s\MobileApi\error CS0006: Metadata file 'd:\a\1\s\ContactActor.Interfaces\bin\Release\ContactActor.Interfaces.dll' could not be found [d:\a\1\s\MobileApi\MobileApi.xproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): Error : d:\a\1\s\MobileApi\error CS0006: Metadata file 'd:\a\1\s\DeviceActor.Interfaces\bin\Release\DeviceActor.Interfaces.dll' could not be found
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : d:\a\1\s\MobileApi\error CS0006: Metadata file 'd:\a\1\s\DeviceActor.Interfaces\bin\Release\DeviceActor.Interfaces.dll' could not be found [d:\a\1\s\MobileApi\MobileApi.xproj]
      Compilation failed.
          3 Warning(s)
          2 Error(s)
      Time elapsed 00:00:01.7675632

请参考以下步骤:

  1. 使用Azure Service Fabric应用程序模板创建新的生成定义
  2. 将Visual Studio版本更改为Visual Studio 2015的Visual Studio构建步骤。
  3. 选择NuGet安装程序步骤/任务,在“ 高级”部分中将NuGet版本更改为3.5.0
  4. 选择选项选项卡,然后将默认代理队列更改为托管
  5. 使用托管代理构建队列。 (未托管VS 2017)

所有构建步骤:

  1. NuGet安装程序(NuGet恢复***。sln)
  2. .Net Core(dotnet还原)
  3. Visual Studio生成(生成解决方案***。sln)
  4. Visual Studio生成(生成解决方案***。sfproj)
  5. 复制文件
  6. 删除文件
  7. 更新Service Fabric应用程序版本
  8. 复制文件
  9. 发布构建工件

暂无
暂无

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

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