我在CSharpInteractive.rsp看到你可以在GAC中使用添加引用一个DLL / R:
I see in the CSharpInteractive.rsp you can add a reference to a DLL in the GAC using /r:
你如何添加引用到自己的DLL?
How do you add references to your own DLLs?
我想System.Reflection.Assembly.LoadFrom,它并没有失败,但没有奏效。
I tried System.Reflection.Assembly.LoadFrom, it didn't fail but didn't work.
我想引用添加到我的DLL有扩展方法。
I am trying to add a reference to my DLL that has extension methods.
如果我试图直接在交互式窗口中添加了code的扩展方法我得到这个错误:
If I try to add the code for the extension method directly in the interactive window I get this error:
错误CS1109:扩展方法必须在顶级静态类中定义; XYZ是一个嵌套类
error CS1109: Extension methods must be defined in a top level static class; XYZ is a nested class
您应该可以指定一个完整路径,装配,以同样的方式为GAC组件。
You should be able to specify a full path for the assembly, in the same way as the gac assembly.
通常你并不需要,虽然改变的RSP。您可以使用一个定期提交补充参考资料:
Normally you don't need to change the rsp though. You can add references in a regular submission using:
#r "path"
免责声明:我在微软工作的罗斯林小组
Disclaimer: I work at Microsoft on the Roslyn team.