orleans: .NetCore2.0 Runtime Codegen fail in Orleans TechPreview3 (reopen issues #3404)
When I build a .net core 2.0 application with Orleans , I already add reference Orleans.OrleanCodeGenerator to my Client and Server , but the orleans silo server not load the grains dll , and occur this error :
Unhandled Exception: System.ArgumentException: Cannot find an implementation class for grain interface: Orleans.Interface.IPlayerGrain. Make sure the grain assembly was correctly deployed and loaded in the silo.
at Orleans.GrainFactory.GetGrainClassData(Type interfaceType, String grainClassNamePrefix)
at Orleans.GrainFactory.GetGrain[TGrainInterface](Int64 primaryKey, String grainClassNamePrefix)
at Orleans.Client.Program.Main(String[] args) in C:\Users\Administrator\Documents\visual studio 2017\Projects\OrleansCore\Orleans.Client\Program.cs:line 14
thats my code :
Interface :
public interface IPlayerGrain : IGrainWithIntegerKey
{
Task SayHello(string content);
}
Grain :
public class PlayerGrain : Orleans.Grain , IPlayerGrain
{
public Task SayHello(string content)
{
Console.WriteLine($"Say {content} to {this.GetPrimaryKeyLong()}");
return Task.CompletedTask;
}
}
Client :
var config = ClientConfiguration.LocalhostSilo();
GrainClient.Initialize(config);
var player = GrainClient.GrainFactory.GetGrain<IPlayerGrain>(1000);
player.SayHello("Hi!!!");
Console.WriteLine("Press any key to terminate!");
Console.ReadKey();
Server:
var config = ClusterConfiguration.LocalhostPrimarySilo();
var siloHost = new SiloHost("Orleans",config);
siloHost.InitializeOrleansSilo();
siloHost.StartOrleansSilo(true);
Console.WriteLine("Press any key to terminate!");
Console.ReadKey();
In issues #3404 , I made a mistake that the PlayerGrain
have not inherit Orleans.Grain
class , then I fixed it , but the the problem still occurs . Has another one has this issues ?
@ReubenBond
@Cherrs 我不知道该怎么联系你,希望你能看到 ,你的 测试用例,我用VS2017运行之后还是出现这个问题
Client build directory:
C:\Users\Administrator\Documents\Visual Studio 2017\Projects\OrleansCore\Orleans.Client\bin\Debug\netcoreapp2.0 的目录
2017/09/14 23:43 <DIR> .
2017/09/14 23:43 <DIR> ..
2017/09/14 23:43 0 Client-2017-09-14-15.43.20.901Z.log
2017/09/18 11:57 103,172 Orleans.Client.deps.json
2017/09/18 23:54 5,120 Orleans.Client.dll
2017/09/18 23:54 628 Orleans.Client.pdb
2017/09/18 11:57 252 Orleans.Client.runtimeconfig.dev.json
2017/09/18 11:57 154 Orleans.Client.runtimeconfig.json
2017/09/18 23:54 4,096 Orleans.Interface.dll
2017/09/18 23:54 252 Orleans.Interface.pdb
8 个文件 113,674 字节
2 个目录 76,443,254,784 可用字节
Server build directory:
C:\Users\Administrator\Documents\Visual Studio 2017\Projects\OrleansCore\Orleans.Server\bin\Debug\netcoreapp2.0 的目录
2017/09/14 23:42 <DIR> .
2017/09/14 23:42 <DIR> ..
2017/09/14 23:49 32,461 Orleans-2017-09-14-15.42.43.444Z.log
2017/09/18 23:54 4,608 Orleans.Grain.dll
2017/09/18 23:54 576 Orleans.Grain.pdb
2017/09/18 23:54 4,096 Orleans.Interface.dll
2017/09/18 23:54 252 Orleans.Interface.pdb
2017/09/18 11:57 95,010 Orleans.Server.deps.json
2017/09/18 23:54 5,120 Orleans.Server.dll
2017/09/18 23:54 632 Orleans.Server.pdb
2017/09/18 11:57 252 Orleans.Server.runtimeconfig.dev.json
2017/09/18 11:57 154 Orleans.Server.runtimeconfig.json
10 个文件 143,161 字节
2 个目录 76,443,447,296 可用字节
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (16 by maintainers)
@sergeybykov It’s worked for me , when I upgrade the Visual Studio 2017 from 15.3.2 to 15.3.4 . 😄