chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
Is it possible to map an object with a protected or internal constructor?

I keep getting constructor not found error.

Thanks.
asked by jnapier (9.6k points)

2 Answers

0 votes
Is it possible to map an object with a protected or internal constructor?


Hi, with version 3.0 you can mock an object with a protected constructor.
Internal constructors are not supported yet.
We already have this requirment on our to do list, although there are .NET security issues when trying to instantiate an internal constructor.

If you own the internal constructor code you can decorate it with StrongNameIdentityPermission for .NET 1.x or use friend in .NET 2.0

I hope this helps
answered by scott (32k points)
0 votes
Thanks. I'll upgrade to version 3.0
answered by jnapier (9.6k points)
...