Excluding Sitecore Assemblies from Deployment using Publish Settings

During another recent conversation on Sitecore Slack chat we discussing solutions with a large number of projects, and the fact that it is recommended to set CopyLocal=false for references (see here and here) since it optimizes Visual Studio builds and can reduce build times. The problem however is that setting this value causes you to lose Intellisense from your Razor Views/Webform controls, although everything should continue to build and work as expected though.

intellisense-vs-razor

That’s a fairly big price to pay! Another advantage of setting CopyLocal=false is that those DLLs are not included in the output directory of your build. More than likely you have a process to deploy a vanilla instance of Sitecore to the server or it is installed on the server, so there is no need to re-deploy the basic DLLs like Sitecore.Kernel.dll or Sitecore.Mvc.dll for example. More recently, we had an issue where the local version of our Coveo install was a slightly different version to the ones on the server, which meant that these assemblies should not be deployed either.

Read More