Registering WinSCPnet.dll

Advertisement

DarylPrice
Donor
Joined:
Posts:
2
Location:
Portland, OR USA

Registering WinSCPnet.dll

I am trying run your application in PowerShell, but have tried in VS 2013. The steps I have followed are below:

I have attempted to register the dll, and it always says it has successfully done.
I am using Windows 7 Pro 64 bit.
When I tried this at home with my 8.1 Windows machine it worked fine. The Windows 7 machine is at work, and I have full admin rights on the machine. I am a admin on our Domain.

I have tried the:
%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb
and it says successful, and tried it without the 64. They both say successful.

When I try:
AddType -Path "WinSCOnet.DLL"
I get the following:
Add-Type : Could not load file or assembly 'file:///C:\allmystuff\Powershell Script\WinSCPnet.DLL' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 
0x80131515)
At line:1 char:3
+   Add-Type -Path "WinSCPnet.DLL"
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-Type], FileLoadException
    + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.AddTypeCommand
I have tried running in a number of files. Tried the Unblock in the dll. Checked the Registry and it shows it is in there, but not sure what I should see.

I would like to iterate I am not a developer, just trying to get things done with limited budgets.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Registering WINSCPNET.DLL

You do not need to register the assembly at all to use it from PowerShell. Registering is needed for COM only (e.g. VBScript, JScript, VBA, etc).

I'm getting the exactly same error message, when the assembly is blocked only. Are you sure that there's no Unblock button on .dll's Properties window in Explorer? Are you sure you are loading a correct copy of the assembly? Did you try using a full path?

You can also try to debug loading of the assembly, but it's rather advanced task:
https://www.meadow.se/wordpress/viewing-assembly-binding-logs-using-fuslogvw-exe/

Reply with quote

DarylPrice
Donor

I have found the answer

Or I should say our System Admin found it. We set my User Account Control Settings to never notify and it works fine now.

I want to thank the immediate responses I received. This is a fantastic product!!

Reply with quote

martin
Site Admin
martin avatar

Re: I have found the answer

Thanks for sharing your solution. I'd like to document it. Though, I do not know what does it mean "to never notify". Can you please provide us more details?

Reply with quote

Advertisement

You can post new topics in this forum