weidazhao / Hosting

Hosting prototype
170 stars 35 forks source link

Request to Add Reliable Actor Project #30

Closed ajaysingh77 closed 8 years ago

ajaysingh77 commented 8 years ago

Hi,

Not sure whether it is right place to ask this or not. if not please do let me know. you recently convert the solution to use dotnet core rc2 and latest service fabric runtime 2.1.115. I am trying to build reliable actor based project using dotnet core rc2 console app template.As there is no template for this in visual studio 2015 (the latest release add template for stateless services using aspnet core) I configured the project manually but after deployment on local machine it shows error on service fabric explorer but if use the same codebase with existing "Actor Service" template it's working fine. Not sure whether I am missing something or not. I attached the error file. It would be great if you add one sample project for reliable actor using dotnet core console app or point m to some resource.

Thanks, Ajay Code_ConsoleApp1Pkg_M_0.txt

weidazhao commented 8 years ago

For now we don't support Actor in the new .xproj form. The problem is that VS needs to run a utility tool called FabActUtil.exe to generate ServiceManifest.xml and update ApplicationManifest.xml for you during build. The tool doesn't work with .xproj at the moment. If you open the ServiceManifest.xml in your Actor .xproj, you should see it empty.

The workaround (which is non-straightforward) is to author the ServiceManifest.xml and ApplicationManifest.xml manually. It might be a bit easier if you could copy them from a working solution and make changes.

ajaysingh77 commented 8 years ago

Hi weidazhao,

I have authored both ServiceManifest.xml and ApplicationManifest.xml manually but after deployed most of the time I am getting the "Error event: SourceId='System.FM', Property='State'. Partition is below target replica or instance count." After checking the log files I figure out the code in program.cs is not working and generating exception.

`public static void Main(string[] args) {

        try
        {
            ActorRuntime.RegisterActorAsync<Actor1>(
               (context, actorType) => new ActorService(context, actorType, () => new Actor1())).GetAwaiter().GetResult();

            Thread.Sleep(Timeout.Infinite);
        }
        catch (Exception e)
        {
            ActorEventSource.Current.ActorHostInitializationFailed(e.ToString());
            throw;
        }
    }`

It seems the codepackage is not activating this code causing the deployment fail.