Can I create a nuget package without a project fil

2019-08-15 05:28发布

问题:

We are trying to integrate Octopus-Deploy with our existing build process. Octopus-Deploy expects nuget packages to deploy. Now, for a variety of reasons, we change various file configurations after the build against the compiled files, so if we used the octopack tool, the packaging happens too early in our build process for us.

We will end up with a folder of e.g. mywebsite_QA and mywebsite_UAT, each containing the correct config files, etc, and it is thesefolders that we wish to deploy.

I would like to take these already built files, (mostly web applications) and turn them into nuget packages.

I am a bit of a noob with nuget, and I cannot see an easy way to do this, because it seems to require a project file or assembly.

Is there some way to take a web site directory structure and turn it into a nuget package?

回答1:

Yes you can, see the Nuget pack documentation http://docs.nuget.org/docs/reference/command-line-reference#Pack_Command

Just run nuget.exe with the right options during your build process.

If you are using TeamCity, you can use it's Nuget package step.