Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 CSharpInteractive.rsp 中看到,您可以使用 /r 在 GAC 中添加对 DLL 的引用:
您如何添加对您自己的 DLL 的引用?
我尝试了 System.Reflection.Assembly.LoadFrom,它没有失败但没有工作。
我正在尝试添加对具有扩展方法的 DLL 的引用。
如果我尝试直接在交互式窗口中添加扩展方法的代码,我会收到此错误:
错误 CS1109:扩展方法必须定义在顶级静态类中;XYZ 是一个嵌套类
您应该能够以与 gac 程序集相同的方式为程序集指定完整路径。
通常,您不需要更改 rsp。您可以使用以下方法在常规提交中添加参考:
#r "path"
免责声明:我在 Microsoft 的 Roslyn 团队工作。