Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load a dll from shared network drive in C#

Tags:

c#

dll

I am able to load the dll using this form -

System.Reflection.Assembly assembly =
System.Reflection.Assembly.LoadFile(@"C:\Users\amit.pandey\Documents\Visual Studio 2010\Projects\bin\Release\EUtility.dll");

However I need to load the dll from a shared network drive in the following manner -

System.Reflection.Assembly assembly =
System.Reflection.Assembly.LoadFile(@"\\falmumapp20\EUtility.dll");

I know it is caused because of trust problem. I have tried various code available but could not get it working. Can someone please help me with sample code for loading the dll from a network drive?

I want to do it in the code itself, without making change to any configuration file.

like image 496
Amit Pandey Avatar asked Dec 16 '22 17:12

Amit Pandey


1 Answers

You need to tell the machine to trust that location.

You can do this with the caspol utility.

like image 122
hometoast Avatar answered Dec 30 '22 07:12

hometoast