Service Fabric Application doesn't register and run the Actor

312 Views Asked by At

I am developing APIs with Service Fabric into a big solution. After I created the services I needed (an Actor, a stateful and a stateless with .NET Framework) and I made a walking skeleton of the APIs. I started to test and service fabric always threw the error "Service does not exist" (I'm 100% sure that the uri was right) when was the time to call the Actor (same error with both ActorProxyFactory and ActorProxy). I wathced on Cluster Explorer and under my SF App there was only the other two service. But the ActorServiceType was registered.

So I decide to create two simple SF app with an actor and I got the same error and also I don't see them on Cluster explorer.

In no projects I touched the ServiceManifest, ApplicationManifest or whatelse.

Here the versions of the tools I use:

  • Windows 11 Enterprise
  • Visual Studio Enterprise v16.11.9 with .Net Framework 4.7.1
  • Service Fabric Runtime 8.1.321.9590
  • Serive Fabric SDK 5.1.321.9590
  • Nuget Microsoft.SerivceFabric 8.1.321
  • Nuget Microsoft.ServiceFabric.Actors 5.1.321 (For the nuget packages I tried everything)
  • Microsoft.VisualStudio.Azure.Fabric.MSBuild 1.7.6 (also this I tried every version)

My auto-generated setting.xml:

<?xml version="1.0" encoding="utf-8"?>
<Settings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <Section Name="MyActorServiceReplicatorConfig">
    <Parameter Name="ReplicatorEndpoint" Value="MyActorServiceReplicatorEndpoint" />
    <Parameter Name="BatchAcknowledgementInterval" Value="0.005" />
  </Section>
  <Section Name="MyActorServiceReplicatorSecurityConfig">
    <Parameter Name="CredentialType" Value="None" />
  </Section>
  <!-- The content will be generated during build -->
</Settings>

My auto-generated service-manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="MyActorPkg" Version="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <ServiceTypes>
    <StatefulServiceType ServiceTypeName="MyActorServiceType" HasPersistedState="true">
      <Extensions>
        <Extension Name="__GeneratedServiceType__" GeneratedId="5f4d2e71-68d5-43f4-b8a3-60990017b54d|Persisted">
          <GeneratedNames xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
            <DefaultService Name="MyActorService" />
            <ReplicatorEndpoint Name="MyActorServiceReplicatorEndpoint" />
            <ReplicatorConfigSection Name="MyActorServiceReplicatorConfig" />
            <ReplicatorSecurityConfigSection Name="MyActorServiceReplicatorSecurityConfig" />
            <StoreConfigSection Name="MyActorServiceLocalStoreConfig" />
            <ServiceEndpointV2_1 Name="MyActorServiceEndpointV2_1" />
          </GeneratedNames>
        </Extension>
      </Extensions>
    </StatefulServiceType>
  </ServiceTypes>
  <CodePackage Name="Code" Version="1.0.0">
    <EntryPoint>
      <ExeHost>
        <Program>MyActor.exe</Program>
      </ExeHost>
    </EntryPoint>
  </CodePackage>
  <ConfigPackage Name="Config" Version="1.0.0" />
  <Resources>
    <Endpoints>
      <Endpoint Name="MyActorServiceEndpointV2_1" />
      <Endpoint Name="MyActorServiceReplicatorEndpoint" />
    </Endpoints>
  </Resources>
  <!-- The content will be generated during build -->
</ServiceManifest>

my auto-generated application-manifest:

<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="MyActorPkg" Version="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <ServiceTypes>
    <StatefulServiceType ServiceTypeName="MyActorServiceType" HasPersistedState="true">
      <Extensions>
        <Extension Name="__GeneratedServiceType__" GeneratedId="5f4d2e71-68d5-43f4-b8a3-60990017b54d|Persisted">
          <GeneratedNames xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
            <DefaultService Name="MyActorService" />
            <ReplicatorEndpoint Name="MyActorServiceReplicatorEndpoint" />
            <ReplicatorConfigSection Name="MyActorServiceReplicatorConfig" />
            <ReplicatorSecurityConfigSection Name="MyActorServiceReplicatorSecurityConfig" />
            <StoreConfigSection Name="MyActorServiceLocalStoreConfig" />
            <ServiceEndpointV2_1 Name="MyActorServiceEndpointV2_1" />
          </GeneratedNames>
        </Extension>
      </Extensions>
    </StatefulServiceType>
  </ServiceTypes>
  <CodePackage Name="Code" Version="1.0.0">
    <EntryPoint>
      <ExeHost>
        <Program>MyActor.exe</Program>
      </ExeHost>
    </EntryPoint>
  </CodePackage>
  <ConfigPackage Name="Config" Version="1.0.0" />
  <Resources>
    <Endpoints>
      <Endpoint Name="MyActorServiceEndpointV2_1" />
      <Endpoint Name="MyActorServiceReplicatorEndpoint" />
    </Endpoints>
  </Resources>
  <!-- The content will be generated during build -->
</ServiceManifest>

my local1node.xml file:

<?xml version="1.0" encoding="utf-8"?>
<Application xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="fabric:/TEST2.MYACTOR.SF" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <Parameters />
</Application>

screens cluster explorer:

screen cluster explorer

screen cluster explorer service type

1

There are 1 best solutions below

0
Andrea Zanetti On

The solution of this problem found on this github issue with a step-by-step guide.
In few words if you have more than installation of Visual Studio (2019 and 2022) a service fabric package cache go in conflict.