Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

How to extract package contents at package install time?

$
0
0

I'm working on a NuGet package that will store my common build/release scripts for reuse, as suggested here:

https://stackoverflow.com/a/52443814

As such, the package's contents should be extracted when it's installed (or overwritten when it's updated), so that the scripts can be pushed to the server as part of the containing project's repo, to be consumed in turn by that project's pipeline. Old news: execution of Install.ps1 and Uninstall.ps1 scripts are deprecated, so that's not an option.

I built a simple test package from this NuSpec file:

<?xml version="1.0"?><package ><metadata><id>PipelineScripts</id><version>$version$</version><title>PipelineScripts</title><authors>InteXX</authors><owners>InteXX</owners><requireLicenseAcceptance>false</requireLicenseAcceptance><description>Common scripts for use in build/release pipelines</description><copyright>Copyright &#169; 2021</copyright></metadata><files><file src="Script.ps1"></file></files></package>

It installs fine into another project, but Script.ps1 doesn't get extracted.

Is it possible to have my package's contents extracted at installation time? If so, how do I do this?

That said... if I'm barking up the wrong tree here, if there's a better way to accomplish my end goal of script reuse in pipelines, I'd be pleased to hear about it. (YAML isn't an option presently; I'm using Classic pipelines.)


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>