I guess what you prefer, is turning off CopyLocal
when referencing assemblies in Visual Studio
The steps could be:
- Open
Solution Explorer
- Right click at the reference item (project or assembly)
- Select
Properties
in the context menu. - Set
CopyLocal
toFalse
(default is true)
Then the references won't be copied to your project\bin\debug
or etc.
UPDATE
You still need to copy your dependency to the same folder, or GAC, or probing paths to run your application.
That is how .Net resolve the assemblies references.
You may refer to How the Runtime Locates Assemblies.
UPDATE 1
MSDN Specifying an Assembly's Location
Using the <probing>
Element
The runtime locates assemblies that do not have a code base by probing. For more information about probing, see How the Runtime Locates Assemblies.
You can use the element in the application configuration file to specify subdirectories the runtime should search when locating an assembly. The following example shows how to specify directories the runtime should search.
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;bin2\subbin;bin3"/>
</assemblyBinding>
</runtime>
</configuration>
The privatePath
attribute contains the directories that the runtime should search for assemblies. If the application is located at C:\Program Files\MyApp
, the runtime will look for assemblies that do not specify a code base in C:\Program Files\MyApp\Bin
, C:\Program Files\MyApp\Bin2\Subbin
, and C:\Program Files\MyApp\Bin3
. The directories specified in privatePath
must be subdirectories of the application base directory.