問題描述
從程序集中復制 DLL 以進行部署 (Copy DLL From Assembly For Deployment)
NET 在我的本地機器上我在我的本地程序集文件夾上引用了一個 DLL。我想知道如何在我的網站部署中“打包”這個 dll?當我在登台服務器上部署時,它開始抱怨它沒有那個 dll。(它不在登台服務器的 GAC 中)。謝謝。
參考解法
方法 1:
If your referenced DLL will not be in the GAC of the targeted computer then you should place the DLL in your web site's \bin
folder. For asp.net websites, referenced DLLs must exist in the GAC or in the \bin
folder. Alternatively, you could install your DLL into the GAC of your target computer using something like a WebSetup project.
方法 2:
Have you tried setting the DLL reference to CopyLocal = true?
方法 3:
Visual Studio Save the Reference Location as relative paths so put in the a folder in your project and make sure the it proprieties "Copy Local" is true, it will make the VS to copy the file to the output directory.
(by DavidS、Ken Browning、Judah Gabriel Himango、Baget)