loading assembly and createInstance

  • Thread starter Thread starter Daylor
  • Start date Start date
D

Daylor

hi.

im loading assembly from my computer and createInstance from it.
till now it worked ok.

now, im changing the path from :

c:\myfolder\myassembly.dll

to

\\mycomputer\myfolder\myassemly.dll


and i get the next exception when CreateInstance:
-------------
A first chance exception of type 'System.Security.SecurityException'
occurred in mscorlib.dll

Additional information: Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
--------------

the exception occur when, the code in that assembly is accessed to unmanged
code ( com class).

why is that ? the only diffrence is i change the path like i said from
c:\myfolder\myassembly.dll to \\mycomputer\myfolder\myassemly.dll

i try alots of flags and security permissions, but i dont know where to make
the change.
i have feeling is somthing to the evidence parameter in the assembly.load .


hope someone can help
have a nice day.
 
Now your code is running with the Intranet permission set. The permission
set zones (local, intranet, internet, etc) are determined by the path of the
assembly.
Do a few searches on Permission Sets and Code Permissions. You can modify
the target machine's config to alter permissions for intranet zone (not
recommended), or you can sign your assembly and give any assembly with that
signing key more permission (recommended).

-Rob Teixeira [MVP]
 
ok,but i know my problem is permission.
where i can read about setting permissions to assembly ?

im searching for code samples.
or somthing that helps to understand how to change permissions in c#
assembly.
 
Back
Top