Having to add [assembly: GenerateCodeForDeclaringAssembly] is a bit hard to discover, especially when types being used come from nuget packages.
It might be valuable to also offer an MSBuild alternative, just like [InternalsVisibleTo...] can now be done with <InternalsVisibleTo Include=".." /> directly in the csproj.
Something like the following:
<ItemGroup>
<OrleansGenenerator Include="AssemblyPotentiallyFromPackage" />
</ItemGroup>
This way, it should even be possible for the nuget packages themselves to provide this item automatically so that scenarios that use those types in Orleans context, Just Work.