Make internal classes visible to other assemblies

我怕爱的太早我们不能终老 提交于 2019-11-29 10:48:42

问题


Is it possible to make internal classes from my assembly visible to other assemblies?

I know about the AssemblyInfo file and the [assembly: InternalsVisibleTo()] attribute, but it doesn't work in my case.

The main purpose is to make it possible to call methods from LINQPAD, so this [assembly: InternalsVisibleTo("LINQPad")] doesn't work. I don't know why. In my project, I'm using dependency resolver, and it is hard to do such a thing in LINQPAD. Any suggestions?


回答1:


I've just uploaded a new beta that allows this to work.

Add the following attribute to the libraries whose internals you want LINQPad to access:

[assembly: InternalsVisibleTo("LINQPadQuery")]

You'll also need to enable this feature in LINQPad's preferences (Edit | Preferences | Advanced).

Let me know how you get along.



来源:https://stackoverflow.com/questions/14354157/make-internal-classes-visible-to-other-assemblies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!