views:

210

answers:

3

Hi, I have an assembly (it's a DLL) I want to know if it's private or public?? How can I do that, it exists a program to do that? or Visual Studio can tell you? Thanks

A: 

Unfortunately I don't think there's a good way to figure this out. The best way I know of is to use Reflector to view a decompiled version of the assembly.

Hope that helps, Ian

Ian Suttle
thanks for the link I'll try the program
Omar Abid
A: 

What do you mean an assembly is private or public? Maybe you mean function is private or public?

But I think you may try Reflector.

Ken Yao
yes and even assemblies can be private or public
Omar Abid
+2  A: 

I assume you are referring to Isolated Applications Concept of Private Assemblies. In this case the assembly requires a manifest (essentially indicating its version) and may be in some local folder or in the Side by Side cache (the SxS folder). Detecting the manifest would be a reasonable indication the dll is private (though I think this is not a 100% test it may be sufficient for your needs)

The concept of private assemblies isn't really relevant to .Net in the sense that simply placing a dll in some arbitrary folder on the Application's private bin path is sufficient, there is nothing special about the assembly in this context.

There is the concept of the GAC, roughly speaking similar to the SxS cache for unmanaged dlls. Any assembly in there will be more easily accessible but the public/private concepts applicable to classes, methods, members is in no way applicable to assemblies.

As a final note you may (though I don't believe you are) be thinking of the 'friend' assembly concept. This can be done via the InternalsVisibleTo attribute at the assembly level or through StrongNameIdentityPermission at the type level.

ShuggyCoUk