在本地部署Service Fabric项目:“ FABRIC_E_IMAGEBUILDER_UNEXPECTED_ERROR”

时间:2019-10-18 19:09:59

标签: c# deployment visual-studio-2017 azure-service-fabric

我们的公司从Service Fabric Microservices开始。

我们按照MS文档所述(https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started)安装Azure Service Fabric SDK。我们从WebPI安装它,以管理员身份打开Powershell,然后运行“ Set-ExecutionPolicy”命令。 后来,我们在Visual Studio中安装了Azure工具,然后我们就可以创建一个示例项目,一个无状态项目。

在项目加载所有依赖项之后,我们立即“启动”项目。 (VS以管理员身份运行) VS将本地群集设置为1个节点并部署微服务。到目前为止,一切都还可以。

然后,我们创建另一个无状态项目,然后做同样的事情。但是,这次我们在VS的输出控制台和Service Fabric Explorer中遇到了错误。

    2>Started executing script 'Deploy-FabricApplication.ps1'.
    2>powershell -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command ". 'C:\Users\xxxxx\source\repos\Application2\Application2\Scripts\Deploy-FabricApplication.ps1' -ApplicationPackagePath 
    'C:\Users\xxxxx\source\repos\Application2\Application2\pkg\Debug' -PublishProfileFile 
    'C:\Users\xxxx\source\repos\Application2\Application2\PublishProfiles\Local.1Node.xml' -DeployOnly:$true -ApplicationParameter:@{_WFDebugParams_='[{"""CodePackageName""":"""Code""","""CodePackageLinkFolder""":"""C:\\Users\\xxxx\\source\\repos\\Application2\\Actor1\\bin\\Debug\\netcoreapp3.0\\win7-
    x64""","""ConfigPackageName""":"""Config""","""ConfigPackageLinkFolder""":"""C:\\Users\\xxx\\source\\repos\\Application2\\Actor1\\PackageRoot\\Config""","""DataPackageName""":null,"""DataPackageLinkFolder""":null,"""LockFile""":"""C:\\Users\\xxxx\\source\\repos\\Application2\\Actor1\\bin\\Debug\\netcoreapp3.0\\win7-x64\\_VS_ServiceFabric_lock.txt""","""WorkingFolder""":"""C:\\Users\\xxxx\\source\\repos\\Application2\\Actor1""","""ServiceManifestName""":"""Actor1Pkg""",
    """EntryPointType""":"""Main""","""DebugExePath""":null,"""DebugArguments""":null,"""DebugParametersFile""":"""C:\\Users\\xxx\\source\\repos\\Application2\\
    Actor1\\bin\\Debug\\netcoreapp3.0\\win7-x64\\_VS_ServiceFabric_debug.txt"""}]'} -
    UnregisterUnusedApplicationVersionsAfterUpgrade $false -
    OverrideUpgradeBehavior 'None' -OverwriteBehavior 'Always' -
    SkipPackageValidation:$true -ErrorAction Stop"
    2>Copying application to image store...
    2>Upload to Image Store succeeded
    2>Registering application type...
    2>Register application type started. Use Get-ServiceFabricApplicationType to query for status.
    2>Running Image Builder process ...
    2>Downloading application package from 'Application2Type' ...
    2>Validating package and computing checksums ...
    2>FABRIC_E_IMAGEBUILDER_UNEXPECTED_ERROR: Se han producido uno o varios errores. --> AggregateException: Se han producido uno o varios errores. --> FileLoadException: El proceso no tiene acceso al archivo porque est  siendo utilizado por otro proceso. (Excepci¢n de HRESULT: 0x80070020)
    2>Registration of application type failed.
    2>En C:\Program Files\Microsoft SDKs\Service 
    2>Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1: 308 Car cter: 17
    2>+                 throw "Registration of application type failed."
    2>+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2>    + CategoryInfo          : OperationStopped: (Registration of application type failed.:String) [], RuntimeException
    2>    + FullyQualifiedErrorId : Registration of application type failed.
    2> 
    2>Finished executing script 'Deploy-FabricApplication.ps1'.
    2>Time elapsed: 00:00:13.0719235
    2>The PowerShell script failed to execute.
    ========== Build: 1 succeeded, 0 failed, 2 up-to-date, 0 skipped ==========
    ========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

我们重置了集群并尝试再次部署2个示例,但是两个微服务都遇到了相同的错误。

我一直在Google,MS Docs和这里寻找解决方案,但是没有人提供解决方案。

1 个答案:

答案 0 :(得分:0)

根据您的日志权限,无法访问某些进程。广泛猜测,这可能与防病毒或您的第一个调试会话有关。

您是否尝试过不调试(启动vs),而是在集群重置\重新启动后发布解决方案(部署项目->右键单击->发布)?