1

I have a customer with two PCs in a domain. I use sevenzipsharp in a project which I load via LoadAssembly because the project/DLL is used from an external scripting language. The two PCs are (as far as the customer told me) configured the same and the users on those systems have the same user rights. On one PC the loading is successful on the other PC the loading fails. To reproduce the error I used a simple PowerShell command

Add-Type -path ".\SevenZipSharp.dll"

the exception that I get is "Could not load file or assembly … or one of its dependencies"

As far as I can see the References are mscorlib, System, System.Configuration, kernel32.dll, System.Core and System.Xml. Those dependencies should all be available on the System since .Net 4.5 is installed.

Are there any user rights or configuration that could block LoadAssembly(C#)/Add-Type(PowerShell)? Because the source code seems to be fine since it is widely used. What could block the LoadAssembly?

Bongo
  • 2,933
  • 5
  • 36
  • 67
  • Make sure Windows updates are installed. There are different versions of dll in the System32 folder which may not be at the same version. The dlls are part of Windows and non Net. Updates are done from Windows Updates and the motherboard of the machine. Sometimes I've found uploading the motherboard updates from vendor solves some of these issues. – jdweng Nov 10 '20 at 13:28
  • Inspect [`LoaderExceptions`](https://stackoverflow.com/questions/4667078/how-to-retrieve-the-loaderexception-property) to determine whether it was a dependency or the assembly itself that failed to load – Mathias R. Jessen Nov 10 '20 at 14:58

0 Answers0