无法在Linux环境中打包Service Fabric应用程序

时间:2018-02-12 11:51:23

标签: linux azure msbuild azure-service-fabric

我需要打包Service Fabric应用程序,以便将其部署到Azure Service Fabric集群。

在Windows中使用此命令时没有任何错误:

dotnet msbuild SfTestApp/SfTestApp.sfproj /t:Package

但是当我将源代码推送到Bitbucket并尝试将我的应用程序打包到管道时 - 我总是得到相同的错误消息:

/opt/atlassian/pipelines/agent/build/packages/Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4/build/Microsoft.VisualStudio.Azure.Fabric.Application.targets(396,5): error MSB4018: The "GetPackageRootFiles" task failed unexpectedly. [/opt/atlassian/pipelines/agent/build/SfTestApp/SfTestApp.sfproj]
/opt/atlassian/pipelines/agent/build/packages/Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4/build/Microsoft.VisualStudio.Azure.Fabric.Application.targets(396,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path '/opt/atlassian/pipelines/agent/build/SfTestApp/ApplicationPackageRoot\'. [/opt/atlassian/pipelines/agent/build/SfTestApp/SfTestApp.sfproj]
/opt/atlassian/pipelines/agent/build/packages/Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4/build/Microsoft.VisualStudio.Azure.Fabric.Application.targets(396,5): error MSB4018:    at System.IO.UnixFileSystem.FileSystemEnumerable`1.Enumerate() [/opt/atlassian/pipelines/agent/build/SfTestApp/SfTestApp.sfproj]
/opt/atlassian/pipelines/agent/build/packages/Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4/build/Microsoft.VisualStudio.Azure.Fabric.Application.targets(396,5): error MSB4018:    at System.IO.UnixFileSystem.FileSystemEnumerable`1..ctor(String userPath, String searchPattern, SearchOption searchOption, SearchTarget searchTarget, Func`3 translateResult) [/opt/atlassian/pipelines/agent/build/SfTestApp/SfTestApp.sfproj]
/opt/atlassian/pipelines/agent/build/packages/Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4/build/Microsoft.VisualStudio.Azure.Fabric.Application.targets(396,5): error MSB4018:    at System.IO.UnixFileSystem.EnumeratePaths(String path, String searchPattern, SearchOption searchOption, SearchTarget searchTarget) [/opt/atlassian/pipelines/agent/build/SfTestApp/SfTestApp.sfproj]
/opt/atlassian/pipelines/agent/build/packages/Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4/build/Microsoft.VisualStudio.Azure.Fabric.Application.targets(396,5): error MSB4018:    at System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption) [/opt/atlassian/pipelines/agent/build/SfTestApp/SfTestApp.sfproj]
/opt/atlassian/pipelines/agent/build/packages/Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4/build/Microsoft.VisualStudio.Azure.Fabric.Application.targets(396,5): error MSB4018:    at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption) [/opt/atlassian/pipelines/agent/build/SfTestApp/SfTestApp.sfproj]
/opt/atlassian/pipelines/agent/build/packages/Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4/build/Microsoft.VisualStudio.Azure.Fabric.Application.targets(396,5): error MSB4018:    at Microsoft.VisualStudio.Azure.Fabric.BuildTasks.GetPackageRootFiles.FindPackageRootFilesInFileSystem(String fullPackageRootPath) [/opt/atlassian/pipelines/agent/build/SfTestApp/SfTestApp.sfproj]
/opt/atlassian/pipelines/agent/build/packages/Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4/build/Microsoft.VisualStudio.Azure.Fabric.Application.targets(396,5): error MSB4018:    at Microsoft.VisualStudio.Azure.Fabric.BuildTasks.GetPackageRootFiles.Execute() [/opt/atlassian/pipelines/agent/build/SfTestApp/SfTestApp.sfproj]
/opt/atlassian/pipelines/agent/build/packages/Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4/build/Microsoft.VisualStudio.Azure.Fabric.Application.targets(396,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() in E:\A\_work\17\s\src\Build\BackEnd\TaskExecutionHost\TaskExecutionHost.cs:line 631 [/opt/atlassian/pipelines/agent/build/SfTestApp/SfTestApp.sfproj]
/opt/atlassian/pipelines/agent/build/packages/Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4/build/Microsoft.VisualStudio.Azure.Fabric.Application.targets(396,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__25.MoveNext() in E:\A\_work\17\s\src\Build\BackEnd\Components\RequestBuilder\TaskBuilder.cs:line 787 [/opt/atlassian/pipelines/agent/build/SfTestApp/SfTestApp.sfproj]

我已经尝试创建空的Service Fabric应用程序(内部没有任何服务),但错误仍然存​​在。

GetPackageRootFiles 有什么问题(正如我从错误消息中看到的那样)?

2 个答案:

答案 0 :(得分:0)

它看起来像是MSBuild中的一个错误......

  

看起来我们的MSBuild任务中的一个错误,我们将修复它有一些平台特定代码的地方。 FWIW,我们还没有在Linux上测试VS工具/ MSBuild任务,所以你在一些未知的领域工作。

https://github.com/Azure/service-fabric-issues/issues/844

答案 1 :(得分:0)

此错误已在MsBuild 1.6.5中修复