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

Allow internal constructor if InternalsVisibleTo is used #553

Open
giammin opened this issue Jul 10, 2024 · 0 comments
Open

Allow internal constructor if InternalsVisibleTo is used #553

giammin opened this issue Jul 10, 2024 · 0 comments

Comments

@giammin
Copy link

giammin commented Jul 10, 2024

Description

I'm tryng ro fake a class from an external assemly.
That class has only an internal parameterless constructor and the project has the attribute InternalsVisibleTo correctly set.
I can call it from the test project, but if I try to generate a fake for that class I receive this error:

No parameterless constructor defined for type

I understand the logic behind not allowing private constructor but an internal constructor of an InternalsVisibleTo assembly should be allowed

LINQPad Code Example

i cant create a linq pad example because the problem is over 2 different projects/assembly

What alternatives have you considered?

I could set the constructor public but this is not an option for some of those classes

Could you help with a pull-request?

No

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

1 participant