简体   繁体   English

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

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

I have Service Fabric based system created and working on production environment (and development). 我创建了基于Service Fabric的系统,并在生产环境(和开发)中工作。 Everything is ok. 一切都好。 Now I was trying to setup CI on Visual Studio Team Services with provided templates for ASF projects. 现在,我正在尝试使用提供的ASF项目模板在Visual Studio Team Services上设置CI。 Unfortunately my system has Actors (.NET 4.5.2) and WebAPI based on ASP.NET Core 1.1. 不幸的是,我的系统具有基于ASP.NET Core 1.1的Actors(.NET 4.5.2)和WebAPI。 I have references to Actor interfaces project (also .NET 4.5.2) forom .NET Core. 我已经引用了Actor接口项目(也是.NET 4.5.2)forom .NET Core。

When I'm trying to build project with default template I'm recieving error because dotnet restore was not run. 当我尝试使用默认模板构建项目时,由于未运行dotnet restore,因此收到错误消息。 Ok, so I've added step to run dotnet restore but then I'm getting error complaining that it cannot find reference to Actor.Interfaces. 好的,所以我添加了运行dotnet restore的步骤,但随后却收到错误消息,抱怨它找不到对Actor.Interfaces的引用。

dotnet restore also fails on my dev machine but solution build with VS goes ok. 在我的开发机上,dotnet恢复也失败,但是用VS构建解决方案可以。

How can I fix this issue? 如何解决此问题?

[UPDATE] [UPDATE]

Thanks Mardoxx, I've made some progress... now I'm getting below error for *.sln buld. 谢谢Mardoxx,我已经取得了一些进步...现在,我在* .sln buld的错误提示之下。 My solution is VS2015 (set in build task), I've set env to Hosted VS2017. 我的解决方案是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] [UPDATE2]

After taking steps presented by starain-MSFT I'm getting errors during 'dotnet restore': 采取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] [UPDATE3]

Another update after @starain input. @starain输入后的另一个更新。

Now I'm getting error that references (to .NET 4.5.2 projcects from Core projects) could not be found. 现在,我收到错误消息,找不到引用(来自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

Refer to these steps below: 请参考以下步骤:

  1. Create a new build definition with Azure Service Fabric Application template 使用Azure Service Fabric应用程序模板创建新的生成定义
  2. Change Visual Studio Version to Visual Studio 2015 for Visual Studio Build steps. 将Visual Studio版本更改为Visual Studio 2015的Visual Studio构建步骤。
  3. Select NuGet Installer step/task, change NuGet version to 3.5.0 in Advanced section. 选择NuGet安装程序步骤/任务,在“ 高级”部分中将NuGet版本更改为3.5.0
  4. Select Options tab and change Default agent queue to Hosted 选择选项选项卡,然后将默认代理队列更改为托管
  5. Queue build with Hosted agent. 使用托管代理构建队列。 (Not Hosted VS 2017) (未托管VS 2017)

All build steps: 所有构建步骤:

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

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

相关问题 Azure Service Fabric中的ASP.NET Core应用程序中的WebpackDevMiddleware - WebpackDevMiddleware in ASP.NET Core app in Azure Service Fabric 如何在Azure Service Fabric ASP.NET Core有状态服务中获取PartitionInfo? - How to obtain PartitionInfo in an Azure Service Fabric ASP.NET Core stateful service? 如何在Service Fabric ASP.NET Core 2中使用WebListenerCommunicationListener - How to use WebListenerCommunicationListener in Service Fabric ASP.NET Core 2 ASP.NET Core 对 Azure 应用服务的 HTTP 请求缓慢 - ASP.NET Core slow HTTP requests to Azure App Service ASP.net 核心 docker https on Azure 应用服务容器 - ASP.net core docker https on Azure App Service Containers 将ASP.NET Core部署到Azure Web App服务错误 - Deploy ASP.NET Core to Azure Web App Service Error ASP.NET Core应用到Azure应用服务上的Linux - ASP.NET Core app to Linux on Azure App Service 引用ASP.NET Core服务中的Service Fabric Actor类的编译器错误 - Compiler error referencing Service Fabric Actor class from ASP.NET Core service 无法将 ASP.NET Core 2.1 Angular 应用程序部署到 Azure - Unable to Deploy ASP.NET Core 2.1 Angular Application To Azure ASP.Net Core 2无法解析类型服务 - ASP.Net Core 2 Unable to resolve service for type
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM