I create my nuget
packages in gitlab
with the following command line.
nuget pack -Prop Configuration=Release -OutputDirectory nuget %REPONAME%\%APPNAME%\%APPNAME%.csproj
If I declare Build Action
to Content
and Copy To Output Directory
to Always
, it is not applied in the nuget package or rather when I install it.
I'm a little bit confused about the answers here: Set content files to "copy local : always" in a nuget package
I don't have a *.nuspec file. It is automatically generated by the command above.
- I have declared a Install.ps1 file in my solution in
tools/*
- I want to automatically include the
tools
folder with the Install.ps1 script into the nuget package, that this script is invoked on install
Install.ps1 script
param($installPath, $toolsPath, $package, $project)
$configItem = $project.ProjectItems.Item("snap7.dll")
# set 'Copy To Output Directory' to 'Always'
# 0 = Never
# 1 = Always
# 2 = PreserveNewestFile
$copyToOutput = $configItem.Properties.Item("CopyToOutputDirectory")
$copyToOutput.Value = 1
# set 'Build Action' to 'Content'
# 0 = None
# 1 = Compile
# 2 = Content
# 3 = EmbeddedResource
$buildAction = $configItem.Properties.Item("BuildAction")
$buildAction.Value = 2