Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create Nuget package for Dacpac and Powershell script

How do I create a Nuget package in Visual Studio 2013 that includes a dacpac and a Powershell script? Would I have the two files in the same location then call nuget pack {folder name}? The Powershell script essentially deploys the dacpac to Octopus Deploy. I have the pieces, but I'm not sure how to put them together!

like image 258
m00nbeam360 Avatar asked Apr 02 '15 15:04

m00nbeam360


People also ask

How do I create a NuGet package and publish it?

You can configure Visual Studio to automatically generate the NuGet package when you build the project. In Solution Explorer, right-click the project and choose Properties. In the Package tab, select Generate NuGet package on build.

Does NuGet package include dependencies?

nupkg file. The option -IncludeReferencedProjects does include all the referenced project dependencies to the .


1 Answers

Are your Powershell script and dacpac in the Visual Studio project? If not, you may not need to include VS in the process.

You can use either OctoPack or the NuGet command line tool.

Either way, you will need to create a nuspec file before you can run the pack command. You can create one manually following the format in the docs or you can use the nuget spec command to create one. Once you have the nuspec file, you can use nuget pack to create the nupkg file.

If the files have to be in a Visual Studio project, the steps are pretty much the same, but you might have to do a little extra work to get the deploy script in the correct spot for Octopus to call it.

Edit: This was posted recently http://swoogan.blogspot.ca/2015/04/deploying-dacpacs-with-octopus-deploy.html

like image 56
ryan.rousseau Avatar answered Oct 10 '22 05:10

ryan.rousseau