In Visual Studio 2008, I added WinScp.dll (in project root) as a reference and immediately there was a yellow icon. At compile-time:
- The type or namespace name 'WinSCP' could not be found (are you missing a using directive or an assembly reference?)
- Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not load file or assembly 'E:...\winscp.exe' or one of its dependencies. The module was expected to contain an assembly manifest.
After an hour's frustration, I figured out that if I removed WinSCP.exe as a project file (also in project root), everything compiled fine. Weird!!!!
The problem is that I need both WinSCP.dll and WinSCP.exe in my output directory. What do I do?
EDIT: I understand that there are workarounds, such as renaming the files or changing the paths. I renamed the exe at first; now I rename the dll (thanks @Michael) because it does not require me to also specify the renamed exe in my code.
But why is there a problem in the first place? WinSCP.dll and WinSCP.exe are two different files. Is this a bug in Visual Studio, or an intricacy of dll/exe that I don't understand?