Service Fabric:找不到入口点 Blah.exe

Service Fabric: The EntryPoint Blah.exe is not found

我重命名了一些项目并更改了文件夹结构,现在我无法将我的 Service Fabric 应用程序部署到我的本地 Service Fabric 集群。

Register-ServiceFabricApplicationType : The EntryPoint IdentityService.exe is not found.


更多日志详细信息

Started executing script 'Deploy-FabricApplication.ps1'.

. 'C:\Users\mdepouw\source\repos\TheProject\TheProject.IdentityDomain\TheProject.Identity.App\Scripts\Deploy-FabricApplication.ps1' -ApplicationPackagePath 'C:\Users\mdepouw\source\repos\TheProject\TheProject.IdentityDomain\TheProject.Identity.App\pkg\Debug' -PublishProfileFile 'C:\Users\mdepouw\source\repos\TheProject\TheProject.IdentityDomain\TheProject.Identity.App\PublishProfiles\Local.5Node.xml' -DeployOnly:$true -ApplicationParameter:@{} -UnregisterUnusedApplicationVersionsAfterUpgrade $false -OverrideUpgradeBehavior 'None' -OverwriteBehavior 'Always' -SkipPackageValidation:$true -ErrorAction Stop

Copying application to image store...

Upload to Image Store succeeded

Registering application type...

Register-ServiceFabricApplicationType : The EntryPoint IdentityService.exe is not found.

FileName: C:\SfDevCluster\Data\ImageBuilderProxy\AppType\IdentityAppType\IdentityServicePkg\ServiceManifest.xml

At C:\Program Files\Microsoft SDKs\Service

Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1:251 char:9

  • Register-ServiceFabricApplicationType -ApplicationPathInImage ...

  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    • CategoryInfo : InvalidOperation: (Microsoft.Servi...usterConnection:ClusterConnection) [Register-Servic

    eFabricApplicationType], FabricException

    • FullyQualifiedErrorId : RegisterApplicationTypeErrorId,Microsoft.ServiceFabric.Powershell.RegisterApplicationType

Finished executing script 'Deploy-FabricApplication.ps1'.

Time elapsed: 00:00:26.1378123

The PowerShell script failed to execute.

TheProject.Identity.Service\PackageRoot\ServiceManifest.xml 中,我必须更改 <Program> 以匹配新的 exe 名称

<!-- Code package is your service executable. -->
<CodePackage Name="Code" Version="1.0.0">
    <EntryPoint>
      <ExeHost>
        <Program>TheProject.Identity.Service.exe</Program>
        <WorkingFolder>CodePackage</WorkingFolder>
      </ExeHost>
    </EntryPoint>
</CodePackage>

我没有在我的项目中重命名服务,但几天前我遇到了同样的错误。经过很多时间深入研究这个问题,我终于明白了它的原因。

我在服务的 *.csproj 文件中有这一行:

<SelfContained>false</SelfContained>

删除此字符串后,一切开始正常工作。我不确定为什么 Azure 的团队在这种情况下没有提供更明显的错误。

也许对其他人有帮助。

构建配置在我的例子中是错误的,它被设置为调试发布。

右键单击解决方案 -> 配置管理器,为您的项目更改为调试

我也遇到过这个问题,我在 *.csproj 文件中得到以下两个参数不同。

<AssemblyName>servicename</AssemblyName>
<RootNamespace>servicename</RootNamespace>

也许对其他人有帮助。

我也遇到过同样的问题。我如下更新了 serviceManifest.xml 并解决了问题

<CodePackage Name="Code" Version="1.0.0">
  <SetupEntryPoint>
      <ExeHost>
        <Program>SetupEntryPointTasks.exe</Program>
        <ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="20480"/>
      </ExeHost>
    </SetupEntryPoint>
    <EntryPoint>
      <ExeHost>
        <Program>aaa.exe</Program>
        <ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="20480" />
      </ExeHost>
    </EntryPoint>
  </CodePackage>