Topic "Registering WINSCPNET.DLL"

Author Message
DarylPrice
[View user's profile]
Donor
Joined: 2015-01-28
Posts: 2
Location: Portland, OR USA
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.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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:
http://www.meadow.se/wordpress/viewing-assembly-binding-logs-using-fuslogvw-exe/
DarylPrice
[View user's profile]
Donor
Joined: 2015-01-28
Posts: 2
Location: Portland, OR USA
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!!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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?
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License