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.
我需要将程序集添加到我的 asp.net 应用程序中,而不将本地副本添加到 bin 文件夹,而不将其添加到 GAC。它应该是路径引用,如 C:\bin 并且此文件夹不是应用程序的子文件夹。有人有建议吗?
您可以为此使用反射:
System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFrom("path here");
使用该assembly实例,您可以即时执行方法,并且几乎可以完成所有工作。
assembly
另外值得注意的是,对于 ASP.NET,您以在操作系统中具有较少权限的不同用户身份运行,因此必须对 DLL 所在的文件夹设置适当的权限。