Load assembly from network location

前端 未结 3 1715
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-16 13:50

I am trying to load assembly by :

Assembly component = Assembly.LoadFrom(componentPath);

where componentPath is a full path of

相关标签:
3条回答
  • 2020-12-16 14:27

    Read Best Practices for Assembly Loading to get an idea.
    Also read this msdn blog on .NET Security

    0 讨论(0)
  • 2020-12-16 14:35

    In addition to Furqan Safdar's answer, another option would be to add this tag in the configuration file:

    <configuration>
       <runtime>
          <loadFromRemoteSources enabled="true"/>
       </runtime>
    </configuration>
    

    Hope these links could help:

    http://msdn.microsoft.com/en-us/library/dd409252(VS.100).aspx

    0 讨论(0)
  • 2020-12-16 14:40

    I was having this same issue. The reason was that the Assembly file was blocked by Windows. I resolved it by right clicking on the Assembly file and selecting properties. In the Properties dialog, click Unblock button under the General tab and click Apply and then OK.

    Reference: http://blogs.msdn.com/b/drew/archive/2009/12/24/xunit-and-td-net-fixing-the-attempt-was-made-to-load-an-assembly-from-a-network-location-problem.aspx

    0 讨论(0)
提交回复
热议问题