How to fully trust a non-signed assembly?

695 views Asked by At

I've got an assembly, which works just fine on my own pc, but when I try to reference it on a virtual machine, I'm getting following error:

System.IO.FileNotFoundException: Could not load file or assembly 'X.dll' or one of its ependencies. The specified module could not be found.
File name: 'X.dll'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm,Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at kernelLoader.Program.Main(String[] args)

I'm absolutely sure that the file is at the location specified, and the code works fine on my own machine (where it has been developed). It, together with all referenced assemblies, are compiled for x86 platform.

I think, that the error may be caused by the assembly not being fully trusted.

I can't strong sing the assembly, because it references several assemblies, which are not singed, and to which I don't have the code or the rights to modify.

I suspect that there is a good way of making an assembly trusted on the mashine where I run it.

How do I mark an assembly as trusted so it can be loaded and executed?

1

There are 1 answers

0
cloggins On BEST ANSWER

That exception is usually caused by a missing dll. One thing that can be used is ProcMon. When the missing dll is loaded and an error is through, the file name should show up in ProcMon.