How can I access a C # internal property from a VB.NET project in the same solution?

My Visual Studio 2008 solution has C # and VB.NET projects. From a VB.NET project, how can I access a C # property with its access modifier set to "internal"?

+2


source to share


1 answer


You need to collect assembly friends with InternalsVisibleTo attribute .

Assuming you are not signing your assemblies, this is as simple as adding the assembly level InternalsVisibleTo to your C # project named VB.Net assembly. You usually do this in AssemblyInfo.cs (in the Properties folder)



[assembly:InternalsVisibleTo("MyVbAssemblyName")]

      

+10


source







All Articles