views:

16

answers:

1

Is it possible to compile an assembly to either: only include certain code parts OR Allow access to certain code based on a credential?

I have an assembly that is redistributed. Certain applications will only use/have access to certain functionality and other will need more.

A: 

You can make internal types accessible for certain assemblies using the System.Runtime.CompilerServices.InternalsVisibleToAttribute. But this attribute's intent is to be used in unit test scenarios.

PVitt
Can you control what gets included in the compilation? Can you say include this and not that.
Arnej65
No. I think what you want can only be achieved by code access security. But I'm not so familiar with CAS.
PVitt
This looking like the answer to what I need. Cheers
Arnej65