Is there a way to specify Build Action=None with nuspec?
My company has an assembly versioning package that I've written in powershell and is distributed amongst my colleagues via our internal nuget feed.
There are a couple of template files which can be user-modified afte开发者_JAVA百科r the package in installed. These files are being included in the package which we generate via
nuget pack xxxx.csproj
We've done a little investigation and there files are not packaged when we change the Build Action
to None
.
Is there a way to tell nuspec to add the files to the project with Build Action
set to None
*?
Alternatively is there a way to tell nuget pack
to not include certain files in the package in generates?
- NuGet pack has an Exclude parameter that can be used to filter out files that you don't want in your package.
- If you want to include files that are auto excluded from your project then you need to add a nuspec to your project and add a element that includes that file.
More information here: http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_project http://docs.nuget.org/docs/reference/command-line-reference#Pack_Command
nuget pack
will ignore any files or folders that start with period/full stop. So one easy way would be to rename your template files or the folder they are located in to start with a period/full stop if possible.
精彩评论