I'm getting the exact same error.
, I am unable to register the DLL within the project, if I rename it as per the instruction Wiki, as you can see in the below exception details the system is still trying to load
System.BadImageFormatException was unhandled
HResult=-2146234344
Message=Could not load file or assembly 'WinSCP, Version=1.0.2.2735, Culture=neutral, PublicKeyToken=b5f19f5762436b89' or one of its dependencies. The module was expected to contain an assembly manifest.
Source=FtpCsvBL
FileName=WinSCP, Version=1.0.2.2735, Culture=neutral, PublicKeyToken=b5f19f5762436b89
FusionLog==== Pre-bind state information ===
LOG: User = CELESTIALTEMPLE\Matthew.Hintzen
LOG: DisplayName = WinSCP, Version=1.0.2.2735, Culture=neutral, PublicKeyToken=b5f19f5762436b89
(Fully-specified)
LOG: Appbase = file:///C:/Projects/BST Clients Direct/Scantron/IPaper/IPaperRinconBridge/IPaperRinconBridgeUI/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : FtpCsvBL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Projects\BST Clients Direct\Scantron\IPaper\IPaperRinconBridge\IPaperRinconBridgeUI\bin\Debug\IPaperRinconBridgeUI.vshost.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: WinSCP, Version=1.0.2.2735, Culture=neutral, PublicKeyToken=b5f19f5762436b89
LOG: Attempting download of new URL file:///C:/Projects/BST Clients Direct/Scantron/IPaper/IPaperRinconBridge/IPaperRinconBridgeUI/bin/Debug/WinSCP.DLL.
LOG: Attempting download of new URL file:///C:/Projects/BST Clients Direct/Scantron/IPaper/IPaperRinconBridge/IPaperRinconBridgeUI/bin/Debug/WinSCP/WinSCP.DLL.
LOG: Attempting download of new URL file:///C:/Projects/BST Clients Direct/Scantron/IPaper/IPaperRinconBridge/IPaperRinconBridgeUI/bin/Debug/WinSCP.EXE.
ERR: Failed to complete setup of assembly (hr = 0x80131018). Probing terminated.
StackTrace:
at Scantron.IPaper.BL.FtpDownload..ctor(String directoryPath, String ftpUri, String ftpUserName, String ftpPassword)
at Scantron.IPaper.UI.Main.ImportButton_Click(Object sender, EventArgs e) in c:\Projects\BST Clients Direct\Scantron\IPaper\IPaperRinconBridge\IPaperRinconBridgeUI\Main.cs:line 155
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Scantron.IPaper.UI.Program.Main() in c:\Projects\BST Clients Direct\Scantron\IPaper\IPaperRinconBridge\IPaperRinconBridgeUI\Program.cs:line 15
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: