Closed bouyeijiang closed 6 years ago
Add this package to your QueryLayer project: https://www.nuget.org/packages/Microsoft.Orleans.OrleansCodeGenerator.Build/
it is base on .net core project,but no effect
i got,it can be used.but client exception System.InvalidOperationException:“Cannot find generated GrainReference class for interface 'ICorBusLayer.IQueryLayer'”
i got , still reference https://www.nuget.org/packages/Microsoft.Orleans.OrleansCodeGenerator.Build/
@bouyeijiang Did you get it to work? The combination of Microsoft.Orleans.OrleansCodeGenerator.Build
and AddApplicationPart
should do the job.
yeah,it is to work
Thanks. I'll close this then.
i can't initialize configuration for orleans framework and that exception error about is it: None of the assemblies added to ApplicationPartManager contain generated code. Ensure that code generation has been executed for grain interface and class assemblies.
my code: interface code:
public interface IQueryLayer:IGrainWithIntegerKey { Task<List> QueryPhone(string cond);
}
instance:
public class QueryLayer:Grain,IQueryLayer { static List collection = new List();
public override Task OnActivateAsync()
{
collection.AddRange(new string[] {"12345","23456","1254204","2142212","12451212","1824557" });
return base.OnActivateAsync();
}
function main: var hostBuilder = new SiloHostBuilder().UseLocalhostClustering().Configure(options =>
{
options.ClusterId = "dev";
options.ServiceId = "bouyei";
})
.Configure(options => options.AdvertisedIPAddress = IPAddress.Loopback)
.ConfigureApplicationParts(p => p.AddApplicationPart(typeof(QueryLayer).Assembly).WithReferences())
.ConfigureLogging(logging => logging.AddFilter(x => x == LogLevel.Debug));