问题
I have an ASP.NET Web Application that has several references set. I have Copy Local set to False for several of them, but when I Publish my application it copies the .dlls anyway. How can I turn that off for good? The dlls are registered in the GAC on the web server and I want to make sure that those are references instead of local copies.
Thanks!
回答1:
Do you have the assemblies registered in the GAC on your local developer machine? If not, register them in the GAC there and it should honor your copy local settings when you build the solution there.
回答2:
I might be wrong but I don't recall a publish option to prevent local copy of the referenced assemblies. You might have to remove them manually or write some script or batch files to automate it.
Maybe this article can help: http://www.beansoftware.com/ASP.NET-Tutorials/Deploy-ASP.NET.aspx
回答3:
You could use a Web Deployment Project for this. You can configure that specific files will be deleted after the Build process.
For a Web Deployment Project you need at least VS 2008 SP1.
来源:https://stackoverflow.com/questions/2032318/copy-local-false-ignored-when-i-publish-my-asp-net-web-application