Possible to use an "internal" class in an external assembly?

J

John Nossluap

I've got a third-party assembly dll containing an "internal" class with
some public methods I would very much like to use.

I understand the meaning and reason of setting the accessibility of the
class to internal. But is there any way, dirty or not, I could use this
class and its methods anyway?
 
N

Nick Hounsome

John Nossluap said:
I've got a third-party assembly dll containing an "internal" class with
some public methods I would very much like to use.

I understand the meaning and reason of setting the accessibility of the
class to internal. But is there any way, dirty or not, I could use this
class and its methods anyway?

You want to go out of your way to make your app unmaintainable and to ensure
that a third party can break it in weird and unpredictable ways just by
issuing an upgrade?

Try reflection.
 
J

John Nossluap

Nick said:
You want to go out of your way to make your app unmaintainable and to ensure
that a third party can break it in weird and unpredictable ways just by
issuing an upgrade?

Yah, I'm developing a proof-of-concept prototype for a small audience so
the application's ttl doesn't really matter ;)
Try reflection.

You know for sure its doable or is it just a wild guess?

Thanks for you answer.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

John Nossluap said:
Yah, I'm developing a proof-of-concept prototype for a small audience so
the application's ttl doesn't really matter ;)


You know for sure its doable or is it just a wild guess?

This is easily checkable, it would take you 10 min to write the code and
see if it works or not
 
J

Jon Skeet [C# MVP]

John said:
Yah, I'm developing a proof-of-concept prototype for a small audience so
the application's ttl doesn't really matter ;)


You know for sure its doable or is it just a wild guess?

Thanks for you answer.

It's doable so long as you're in a high trust environment - in other
words, if the system has been told to trust your code to do whatever it
likes, you should be fine.

Jon
 
J

John Nossluap

Ignacio said:
Hi,

This is easily checkable, it would take you 10 min to write the code and
see if it works or not

All truths are easy to understand once they are discovered; the point is
to discover them.
 
J

John Nossluap

Jon said:
John Nossluap wrote:
It's doable so long as you're in a high trust environment - in other
words, if the system has been told to trust your code to do whatever it
likes, you should be fine.

Sounds acceptable, I'll give it a shot. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top