Lea Hayes
Lea Hayes

Reputation: 64196

InternalsVisibleTo using the "Company" property instead of "Assembly Name"?

Is it possible to make the internal functionality of a common utility library available for usage by all assemblies with my company name so that future assemblies can also use the same version?

[assembly: InternalsVisibleTo("The Company Name Instead")]

Upvotes: 2

Views: 460

Answers (1)

Phill
Phill

Reputation: 18796

No it's not possible.

https://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

Specifies that types that are ordinarily visible only within the current assembly are visible to a specified assembly.

The attribute is also sealed so you can't extend it to attempt to implement your own functionality.

It doesn't even support wildcards.

I don't know what the actual problem is you're trying to solve but you may want to reconsider why you need internals visible to, to begin with.

Maybe the utility library can be merged into your assembly using internalize so that you don't have a utility assembly laying around.

Upvotes: 1

Related Questions