使内部类对其他程序集可见 [英] Make internal classes visible to other assemblies
问题描述
是否可以使我的程序集中的内部类对其他程序可见?
Is it possible to make internal classes from my assembly visible to other assemblies?
我知道AssemblyInfo文件和[assembly: InternalsVisibleTo()]
属性,但是在我的情况下不起作用.
I know about the AssemblyInfo file and the [assembly: InternalsVisibleTo()]
attribute, but it doesn't work in my case.
主要目的是使从LINQPAD调用方法成为可能,因此此[assembly: InternalsVisibleTo("LINQPad")]
不起作用.我不知道为什么在我的项目中,我正在使用依赖解析器,而在LINQPAD中很难做到这一点.有什么建议吗?
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?
推荐答案
我刚刚上传了一个新的Beta 使其起作用.
I've just uploaded a new beta that allows this to work.
将以下属性添加到您希望LINQPad访问其内部的库:
Add the following attribute to the libraries whose internals you want LINQPad to access:
[assembly: InternalsVisibleTo("LINQPadQuery")]
您还需要在LINQPad的首选项(编辑|首选项|高级)中启用此功能.
You'll also need to enable this feature in LINQPad's preferences (Edit | Preferences | Advanced).
让我知道你的相处
这篇关于使内部类对其他程序集可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!