美文网首页
AppDomain.CurrentDomain.GetAssem

AppDomain.CurrentDomain.GetAssem

作者: 寻找无名的特质 | 来源:发表于2022-11-05 06:33 被阅读0次

AppDomain.CurrentDomain.GetAssemblies() 这个函数获取当前应用域中已加载的程序集,注意,在Asp.Net Core环境下,bin目录下的程序集不一定都被加载,这与.Net Framework下的情况不同。如果需要加载响应的程序集,需要使用Load方法进行加载,示例如下:
AppDomain currentDomain = AppDomain.CurrentDomain;
//Provide the current application domain evidence for the assembly.
Evidence asEvidence = currentDomain.Evidence;
//Load the assembly from the application directory using a simple name.

    //Create an assembly called CustomLibrary to run this sample.
    currentDomain.Load("CustomLibrary",asEvidence);

相关文章

网友评论

      本文标题:AppDomain.CurrentDomain.GetAssem

      本文链接:https://www.haomeiwen.com/subject/uvzijrtx.html