【问题标题】:Build fails while running AppManifestCleanupUtil executable for Service Fabric App运行 Service Fabric 应用的 AppManifestCleanupUtil 可执行文件时生成失败
【发布时间】:2017-03-18 19:24:48
【问题描述】:

作为我的服务结构应用程序的一部分,我的 ApplicationManifest.xml 与我的其余代码处于源代码控制之下。当构建在构建服务器上运行时,它失败并出现以下异常。这发生在 AppManifestCleanupUtil 的执行期间更新应用程序清单。它在我的机器上运行良好。我在这里错过了什么吗? -

Unhandled Exception: System.UnauthorizedAccessException: Access to the path 'C:\MyProject\ApplicationManifest.xml' is denied.

在 System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 在 System.IO.FileStream.Init(字符串路径、FileMode 模式、FileAccess 访问、Int32 权限、Boolean useRights、FileShare 共享、Int32 bufferSize、FileOptions 选项、SECURITY_ATTRIBUTES secAttrs、String msgPath、Boolean bFromProxy、Boolean useLongPath、Boolean checkHost) 在 System.IO.FileStream..ctor(字符串路径、FileMode 模式、FileAccess 访问、FileShare 共享) 在 Microsoft.ServiceFabric.Services.Common.ExclusiveFileStream.Acquire(字符串路径、文件模式文件模式、文件共享文件共享) 在 AppManifestCleanupUtil.AppManifestCleanupUtil.LoadExistingAppManifest(字符串 appManifestPath) 在 AppManifestCleanupUtil.AppManifestCleanupUtil.CleanUp(字符串 appManifestPath,List1 serviceManifestPaths, List1 appParamFilePaths) 在 AppManifestCleanupUtil.Program.Main(String[] args)

【问题讨论】:

    标签: c# azure-service-fabric


    【解决方案1】:

    在提交到源代码管理之前,请务必在您的开发机器上进行本地构建。这将确保 ApplicationManifest.xml 文件与您的应用程序项目状态保持同步。如果它不是最新的并且文件是只读的,您将收到此错误。

    【讨论】:

    • 谢谢@Matt Thalman,我做到了,但问题是即使存在间距问题,清理实用程序中的内容匹配也会失败,它会尝试更新。我不确定我们项目中有一个庞大的开发团队,这有多可行。
    • 此验证是否应不限于实际元素/内容。 Json 现在经常用于配置(集群清单允许它)。 Service /App manifest 可以不是 Json 而是更容易解析和验证吗?
    猜你喜欢
    • 1970-01-01
    • 2019-04-26
    • 2018-10-04
    • 2018-06-08
    • 2016-12-10
    • 1970-01-01
    • 2015-12-24
    • 2020-10-02
    • 2018-07-24
    相关资源
    最近更新 更多