Proxy is inaccessible due to its protection level
Closed this issue · 2 comments
Hello,
I have an Orleans 3 project which I'm working on to upgrade it to the current version. It has custom code generators written by us.
I migrated it to Orleans 7 and everything is working properly.
Then I started migrating it to v8 and I suddenly get a lot of 'Proxy_MyClass is inaccessible due to its protection level'. As far as I've understood from other GitHub issues, it seems to be a Roslyn problem as the source generators are unordered.
Is there any viable solutions for this problem? There's an intermediary project trick, but I'm looking for a better way to do it :)
Thanks.
Hi @octavian-niculescu10, you're right that this is a Roslyn limitation. Here is the issue for you to upvote / add your feedback on: dotnet/roslyn#57239. I am not aware of nice, clean solutions, only workarounds like what you have come up with already.
For future readings - you can read more about it here: #9100
I managed to make it work by having an intermediary project.
So, for example, if you have a project A which has some GenerateCodeForAssembly attributes, remove them and create a new project B which directly references those assemblies.
Delete the GenerateCodeForAssembly attributes from project A and reference project B and now it should work.