Create a nuspec file that uses all default behavior but adds one additional file

I want to have a file nuspecthat automatically reads all information from packages.config, etc., creating all the dependencies, but also includes only one additional file.

Is there any way to do this?

For example, here is a file nuspecthat does almost what I want:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <metadata>
    <id>My.Project</id>
    <version>1.0.0.0</version>
    <owners>Me</owners>
    <authors>Me</authors>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <title>My.Project</title>
    <description>My.Project</description>
    <frameworkAssemblies />
    <copyright>Copyright ©  2015</copyright>
    <tags></tags>    
  </metadata>
</package>

If my project refers to ten packages nuget, the above nuspecfile will detect this and add them as dependencies when I pack the package together.

But, as soon as I add an element files, then all automatic links to my other nuget dependencies will stop:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <metadata>
    <id>My.Project</id>
    <version>1.0.0.0</version>
    <owners>Me</owners>
    <authors>Me</authors>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <title>My.Project</title>
    <description>My.Project</description>
    <frameworkAssemblies />
    <copyright>Copyright ©  2015</copyright>
    <tags></tags>    
  </metadata>
  <files>
    <file src="myfile.dll" target="lib\net45" />
  </files>
</package>

: csproj .

?! nuspec.

+4
2

, , . Content, ​​ .

0

Octopus Deploy?

Octopus Deploy, , /p:OctoPackEnforceAddingFiles=true, OctoPack , <files>..</files>

https://octopus.com/docs/packaging-applications/nuget-packages/using-octopack/octopack-to-include-buildevent-files

0

All Articles