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

Does not open access to private methods #5

Closed
sturlath opened this issue Nov 30, 2018 · 5 comments
Closed

Does not open access to private methods #5

sturlath opened this issue Nov 30, 2018 · 5 comments

Comments

@sturlath
Copy link

Hi I was trying this out on Strathweb.Samples.CSharp.NoVisibilityChecks and it works for classes but I can't get it to work with the private method Calculate().

Shouldn't it work there also?

image

@aelij
Copy link
Owner

aelij commented Nov 30, 2018

AFAIK the CLR only supports calling internal members with this attribute. So the Publicize task only transforms internal to public. But you can experiment, with the code perhaps it would work with private as well.

@sturlath
Copy link
Author

Thanks. I’ll look into it now that I know what the problem area is.

Somehow he manages to do it here https://www.strathweb.com/2018/10/no-internalvisibleto-no-problem-bypassing-c-visibility-rules-with-roslyn/ (evenhough I havent gotten that to work either 🙈)

@TheFanatr
Copy link

TheFanatr commented Dec 28, 2018

Doesn't work for me either. I tried a whole bunch of combinations of everything from packages to source code in the assembly, and nothing works. I think it may be possible that the CLR team decided that the ability to make everything in a third party assembly public was too dangerous to give to people. Either that or having the .NET Core 3.0 preview installed is messing with CLR in a way that disables this functionality.

@aelij
Copy link
Owner

aelij commented Feb 28, 2021

Closing as it doesn't seem possible

@aelij aelij closed this as completed Feb 28, 2021
@go-live-tech
Copy link

Actually calling private member does work. There's another package similar to this one, MakeTypesPublic, which works flawlessly with private members.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants