Using only specified Assemblys

  • Thread starter Thread starter =?iso-8859-1?B?UmVu6SBQLg==?=
  • Start date Start date
?

=?iso-8859-1?B?UmVu6SBQLg==?=

Hello,

i have a little application that search into a special folder to
assemblys. Founded assembly would be load by Assembly.LoadFrom().

Is there a way to load only assemblys that are from my company? I would
not that 3th party assemblys are loaded. So if i copy an assembly into
this folder on next restart the new assembly should be load only if
have the right strong name, or is certified??

What can i do?

Thanks a lot for any idears.
René
 
Is there a way to load only assemblys that are from my company? I would
not that 3th party assemblys are loaded. So if i copy an assembly into
this folder on next restart the new assembly should be load only if
have the right strong name, or is certified??

What can i do?

You could get the AssemblyName first with
AssemblyName.GetAssemblyName(). Then use the GetPublicKey() method to
check if the assembly has a public key that matches your company.


Mattias
 
Hi,

Use Assembly.LoadFile() method. This will not load the assembly into your
AppDomain but will give you the possiblity the check the assembly out. Find
out what your need to know and then use Assembly.LoadFrom() to load the
assembly into your domain if the assembly applies to your requirements.

Kr. Soren


"René P." <[email protected]> skrev i en meddelelse
Hello,

i have a little application that search into a special folder to
assemblys. Founded assembly would be load by Assembly.LoadFrom().

Is there a way to load only assemblys that are from my company? I would
not that 3th party assemblys are loaded. So if i copy an assembly into
this folder on next restart the new assembly should be load only if
have the right strong name, or is certified??

What can i do?

Thanks a lot for any idears.
René
 
Hi Matias,

what happen if anyone makes the same settings like CompanyName etc? Is
it a secury way to check the PublicKey? How i can compare the PublicKey
from the Assembly to the ExecutingAssembly without writing clear text?

Thanks
René
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top