0

在执行了相当突兀的重构(重命名项目、移动服务等)之后 - 我发现没有为无状态和有状态服务生成 ServiceManifest.xml 和 ApplicationManifest.xml 中的适当配置。

复现步骤:

  1. 右键单击现有服务结构应用程序项目 (.sfproj)
  2. 添加 > 新建 Service Fabric 服务...
  3. 选择无状态服务
  4. 查看 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>
    
  5. 现在删除 ServiceManifest.xml

  6. 重建

我期望在构建时重新创建 ServiceManifest.xml。如果您对 StatefulService 执行上述步骤,您会得到相同的结果。但是,如果您为 ActorService 执行此操作 - ServiceManifest.xml 将完美地重新生成。

如果没有在 ServiceManifest 和 ApplicationManifest 中定义 StatelessService,则不会部署该服务。

这似乎可能是一个错误,有没有人遇到过这个并有解决方案?

4

1 回答 1

0

我在添加新演员时遇到了类似的问题。就我而言,添加新的 Actor Service 后,我必须先构建解决方案,然后再对其进行任何更改。

于 2017-03-03T06:32:18.580 回答