有很多種放置的方式,但最好的方式應該算是在專案下建立一個lib的資料夾,然後修改app.config,加入以下區段:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;bin2\subbin;bin3"/>
</assemblyBinding>
</runtime>
</configuration>
在方案總管中的參考上按下滑鼠右鍵,選加入參考:
用瀏覽的方式把剛剛lib資料夾下的dll加進來:
最後將該參考設定開啟複製到本機,這樣一來運作測試就會正常了。
資料來源參考:
https://docs.microsoft.com/zh-tw/dotnet/framework/configure-apps/specify-assembly-location