Tuesday, July 1, 2014

WinSCP namespace could not be found.

Now my file transfer program has evolve to transfer files from one server to another server. This may involve WinSCP API using C# programming language in the project. Frankly speaking, I'm a noob in C#. In order to work with WinSCP API, the first thing to do is to have WinSCPnet.dll downloaded and put it at the same level with my executable path. Next is to add a reference of this module into the project. Following steps shows how this could be done.

  1. Go to project properties > Reference Paths > Fill in the Folder field with the path where the WinSCPnet.dll is locate. 
  2. Right click on project > Add Reference > Choose Extensions under Reference Manager > Select WinSCPnet. 
Failed to do this will cause an error at following statement:

using WinSCP; 

And this error message could be seen.

The type or namespace name 'WinSCP' could not be found (are you missing a using directive or an assembly reference?)

No comments: