NuGet Tip: Automatically Set 'Copy Local' Property to False
When this property is set to true, the assembly will be copied to the output directory of your project. This can be problematic. For example, with TDS, when you build your solution the output directory of your web application project gets copied to your Sitecore instance. Ideally, you don't want to overwrite or add DLLs to your Sitecore instance by accident. While you can prevent this from happening by maintaining an exclusion list in TDS, it's easy to forget.
How does this relate to NuGet packages?
Usually when you add a new package one or more DLL references are added to your project(s) and almost invariably the Copy Local property will be set to true. If you create your own NuGet package and wish to prevent this, here is a PowerShell script that will do the trick:
Simply add/overwrite the Install.ps1 script found in the "tools" folder of the NuGet package. Voila!
0 comments:
Post a Comment