Orleans: If a grain implementation class doesn't derive from Grain, the error message is unhelpful

Created on 19 Dec 2019  路  2Comments  路  Source: dotnet/orleans

I had a project with IMyGrain which inherited from IGrainWithIntegerKey, but I forget to derive the implementation class from Grain.

This all compiles with no warning (as IGrainWithIntegerKey has no methods to implement), but at runtime fails with "cannot find an implementation class" when I call GetGrain().

I feel this could be more helpfully spotted.

help wanted

Most helpful comment

An analyzer could be used for this, the way Xunit does it.

All 2 comments

We are looking into making inheriting from Grain unnecessary in 4.0. In the meantime, is there a way to give a useful warning? By flagging any non-abstract class that implements IGrainWithXKey and doesn't inherit from Grain?

An analyzer could be used for this, the way Xunit does it.

Was this page helpful?
0 / 5 - 0 ratings