Orleans can not generate code for application part

Viewed 315

I am developing an ASP NET Core Web API using Microsoft Orleans and i keep getting this exception cwhen starting the silo:

None of the assemblies added to ApplicationPartManager contain generated code. Ensure that code generation has been executed for grain interface and class assemblies.

I have checked this Orleans Issue on githubthread and apparently they solved it by adding the Microsoft.Orleans.OrleansCodeGenerator.Build to the dll containing the silo. For me it does not work.

I just use a grain :

var host = CreateHostBuilder(args);
                host.UseOrleans(builder =>
                {
                    builder.UseLocalhostClustering()
                    .Configure<EndpointOptions>(opt => opt.AdvertisedIPAddress = System.Net.IPAddress.Loopback)
                    .AddLogStorageBasedLogConsistencyProvider()
    
                    .ConfigureApplicationParts(parts =>
                    {
                       parts.AddApplicationPart(typeof(PaymentGrain).Assembly);
    
    
                    });
});

Class prototypes:

 public class PaymentGrain : JournaledGrain<PaymentState, PaymentEventBase>, IPaymentGrain {}
 public interface IPaymentGrain:IGrainWithIntegerKey,ISomeOtherMethods{}

I have tried moving the Grain to the same dll as the silo , separating them etc...none of this worked. What is the problem here ? When i am checking the console i get this :

Console Output

info: Orleans.Runtime.Silo[100415]
      Starting silo Silo_8a3d8
warn: Orleans.Runtime.NoOpHostEnvironmentStatistics[100708]
      No implementation of IHostEnvironmentStatistics was found. Load shedding will not work yet
info: Orleans.Runtime.ConsistentRing.VirtualBucketsRingProvider[0]
      Starting VirtualBucketsRingProvider on silo S127.0.0.1:11111:374943811/xC62F3E64.
info: Orleans.Runtime.ConsistentRing.VirtualBucketsRingProvider[103003]
      Added Server S127.0.0.1:11111:374943811/xC62F3E64. Current view: [S127.0.0.1:11111:374943811 -> <MultiRange: Size=x100000000, %Ring=100.000%>]
info: Orleans.Runtime.ConsistentRing.VirtualBucketsRingProvider[103005]
      -NotifyLocalRangeSubscribers about old <(0 0], Size=x100000000, %Ring=100.000%> new <MultiRange: Size=x100000000, %Ring=100.000%> increased? True
info: Orleans.Runtime.Silo[100422]
      -------------- Started silo S127.0.0.1:11111:374943811, ConsistentHashCode C62F3E64 --------------
fail: Orleans.Runtime.Scheduler.OrleansTaskScheduler[101231]
      QueueWorkItem was called on a non-null context [SystemTarget: S127.0.0.1:11111:374943811*stg/13/0000000d@S0000000d] but there is no valid WorkItemGroup for it.
0 Answers
Related