在执行了相当突兀的重构(重命名项目、移动服务等)之后 - 我发现没有为无状态和有状态服务生成 ServiceManifest.xml 和 ApplicationManifest.xml 中的适当配置。
复现步骤:
- 右键单击现有服务结构应用程序项目 (.sfproj)
- 添加 > 新建 Service Fabric 服务...
- 选择无状态服务
查看 ServiceManifest.xml,您将看到:
<!-- Code package is your service executable. --> <CodePackage Name="Code" Version="1.0.0"> <EntryPoint> <ExeHost> <Program>Stateless1.exe</Program> </ExeHost> </EntryPoint> </CodePackage> <!-- Config package is the contents of the Config directoy under PackageRoot that contains an independently-updateable and versioned set of custom configuration settings for your service. --> <ConfigPackage Name="Config" Version="1.0.0" /> <Resources> <Endpoints> <!-- This endpoint is used by the communication listener to obtain the port on which to listen. Please note that if your service is partitioned, this port is shared with replicas of different partitions that are placed in your code. --> <Endpoint Name="ServiceEndpoint" /> </Endpoints> </Resources>
现在删除 ServiceManifest.xml
- 重建
我期望在构建时重新创建 ServiceManifest.xml。如果您对 StatefulService 执行上述步骤,您会得到相同的结果。但是,如果您为 ActorService 执行此操作 - ServiceManifest.xml 将完美地重新生成。
如果没有在 ServiceManifest 和 ApplicationManifest 中定义 StatelessService,则不会部署该服务。
这似乎可能是一个错误,有没有人遇到过这个并有解决方案?