Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for dynamic proxies with non-public interfaces #236

Closed
LiangJy123 opened this issue Feb 12, 2019 · 7 comments · Fixed by #342
Closed

Add support for dynamic proxies with non-public interfaces #236

LiangJy123 opened this issue Feb 12, 2019 · 7 comments · Fixed by #342
Assignees
Milestone

Comments

@LiangJy123
Copy link
Member

Hi~

I got a exception that "Attempting to implement an inaccessible interface"
when running this line:

       var RpcClient = JsonRpc.Attach<IRPCFuntions>(stream);

the IRPCFuntions is defined as follows

         interface IRPCFuntions
        {
             Task<int> SumOfAsync(int a, int b);
             Task<int> DifferenceAsync(int a, int b);
        }

I spent half a day but didn't find what caused the exception, can you help me ?

@AArnott
Copy link
Member

AArnott commented Feb 12, 2019

Make the interface public.

This is something we could enhance to remove the requirement though, so I'll keep the issue active.

@LiangJy123
Copy link
Member Author

Thank you very much!
I used to try to add "public" but the "IRPCFuntions" was defined in the class ,so it didn't work.
After got your tips, I try to define them out of the class and add "public" , it runs successfully.
image

@AArnott
Copy link
Member

AArnott commented Apr 3, 2019

Reopening to track ability to implement internal interfaces.

@AArnott AArnott reopened this Apr 3, 2019
@AArnott
Copy link
Member

AArnott commented Apr 3, 2019

vs-mef does this already (with 95% feature complete).
We should try to consolidate the implementation into a reusable package so that this can be shared between vs-mef, vs-streamjsonrpc and even messagepack.

@AArnott
Copy link
Member

AArnott commented Apr 3, 2019

messagepack issue tracking it: MessagePack-CSharp/MessagePack-CSharp#88

@AArnott AArnott self-assigned this Jul 24, 2019
@peterwald
Copy link
Member

+1 for this feature, to support implementing an RPC protocol without publicly exposing all of the interfaces/types involved.

@AArnott
Copy link
Member

AArnott commented Jul 24, 2019

@peterwald: giving a thumbs up on the issue description is a great way to accumulate votes.

@AArnott AArnott changed the title Attempting to implement an inaccessible interface Add support for dynamic proxies with non-public interfaces Sep 19, 2019
@AArnott AArnott added this to the v2.2 milestone Sep 19, 2019
AArnott added a commit to AArnott/vs-streamjsonrpc that referenced this issue Sep 19, 2019
AArnott added a commit to AArnott/vs-streamjsonrpc that referenced this issue Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants