c# - Visual Studio adding executable file with same name as dll -



c# - Visual Studio adding executable file with same name as dll -

in visual studio 2008, added winscp.dll (in project root) reference , there yellowish icon. @ compile-time:

the type or namespace name 'winscp' not found (are missing using directive or assembly reference?) resolved file has bad image, no metadata, or otherwise inaccessible. not load file or assembly 'e:...\winscp.exe' or 1 of dependencies. module expected contain assembly manifest.

after hour's frustration, figured out if removed winscp.exe project file (also in project root), compiled fine. weird!!!!

the problem need both winscp.dll , winscp.exe in output directory. do?

edit: understand there workarounds, such renaming files or changing paths. renamed exe @ first; rename dll (thanks @michael) because not require me specify renamed exe in code.

but why there problem in first place? winscp.dll , winscp.exe 2 different files. bug in visual studio, or intricacy of dll/exe don't understand?

winscp.dll , winscp.exe 2 different files

not assembly loader, doesn't pay attending filename extension. knows needs find assembly display name of "winscp". when searching match, first tries exe file name, next dll file. can see fuslogvw.exe utility. display names described in blog post microsoft guy worked on fusion component:

the "name" part file name of assembly, excluding extension. assembly foo.dll, "name" part "foo". of course, since said "usually", there times when "name" part not same file name excluding extension. discuss in bit.

emphasis added. finds winscp.exe first , that's kaboom, not valid .net assembly. simple workaround rename dll, changes display name of assembly.

c# visual-studio dll assemblies

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -