Service Fabric Deployment Error: ServiceManifest.xml is missing for service

邮差的信 提交于 2019-12-08 16:03:08

问题


I have added a Stateless Service Fabric project to my solution and set it up as a Web Api self host. I have touched nothing in any of the files added by Visual Studio. The only thing that went slightly wrong was a Git merge error on the solution file, causing me to have to add the projects again manually.

Projects are named as follows:

  • Project name/sfproj: ClientCore.CommandStackApi.Deploy
  • Service name/csproj: ClientCore.CommandStackApi

When I try to deploy, I get the following error:

The BuildLayout of the application in C:\SfDevCluster\Data\ImageBuilderProxy\AppType\ClientCore.CommandStackApi.DeployType is invalid. ServiceManifest.xml is missing for service ClientCore.CommandStackApiPkg.

When I compare files, and all the project settings I can think off, with my other Service Fabric projects everything looks fine, but it keeps complaining that the Service Manifest is missing. The only thing I noticed, was the SF project missing a dependency to the CommandStackApi project, but this didn't change anything.

I've tried on two different computers, the last of which had a fresh install of the Service Fabric SDK etc.

I'm guessing it would work if I remove all projects and set everything up again, but this also happened earlier, when I tried to construct the deploy package and powershell script exactly from the MSDN guide, so I would really like some insight into what I might be doing wrong. If this happens to a more mature project, I won't have the option to recreate the solution from scratch and tap into the Visual Studio blackbox magic setup, that it must be doing behind the scenes. Any ideas, for what might be wrong, would be appreciated.


回答1:


So I finally figured out what was wrong.

I was looking at the files and project dependencies, but missed a missing service dependency. When the two projects were removed from the solution by the merge, the SF project must have lost the service reference. Adding this back in fixed the problem.




回答2:


When I added an existing Service Fabric project (.csproj) to a Service project (.sfproj), I had to create two section manually in the \ApplicationPackageRoot\ApplicationManifest.xml file.

Example:

<ServiceManifestImport>
  <ServiceManifestRef ServiceManifestName="Sample.Service.Commander" ServiceManifestVersion="1.0.0" />
  <ConfigOverrides>
    <ConfigOverride Name="Config">
      <Settings>
        <Section Name="EndpointConfigSection">
          <Parameter Name="UseDifferentPorts" Value="[StatelessServices_UseDifferentPorts]" />
        </Section>
      </Settings>
    </ConfigOverride>
  </ConfigOverrides>
  <Policies>
    <EndpointBindingPolicy EndpointRef="OwinEndpoint" CertificateRef="ClusterCert" />
    <EndpointBindingPolicy EndpointRef="OwinEndpoint0" CertificateRef="ClusterCert" />
    <EndpointBindingPolicy EndpointRef="OwinEndpoint1" CertificateRef="ClusterCert" />
    <EndpointBindingPolicy EndpointRef="OwinEndpoint2" CertificateRef="ClusterCert" />
    <EndpointBindingPolicy EndpointRef="OwinEndpoint3" CertificateRef="ClusterCert" />
    <EndpointBindingPolicy EndpointRef="OwinEndpoint4" CertificateRef="ClusterCert" />
  </Policies>
</ServiceManifestImport>

and

<Service Name="Commander">
  <StatelessService ServiceTypeName="CommanderType" InstanceCount="[MyService_InstanceCount]">
    <SingletonPartition />
  </StatelessService>
</Service>



回答3:


I added removed and added dependency of service project to fabric project and it worked.



来源:https://stackoverflow.com/questions/39165542/service-fabric-deployment-error-servicemanifest-xml-is-missing-for-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!