【发布时间】:2020-02-15 19:20:24
【问题描述】:
我们公司从 Service Fabric 微服务开始。
我们按照 MS 文档 (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started) 的说明安装 Azure Service Fabric SDK。我们从 de 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 和此处寻找解决方案,但没有人提供解决方案。
【问题讨论】:
标签: c# deployment visual-studio-2017 azure-service-fabric