I've been attempting to set up a simple package for Umbraco which creates a few document types and data types. It also has a few classes to do a bit of heavy lifting.
However, what I'd ideally like to do is create a Nuget package so that I can easily install and update the extension. I've managed to get a set up working for me that creates the Nuget package (along with a zip, and the actual Umbraco package itself). This appears to be working for my bin file - the dll is copied across and I can using the namespaces in my other test project.
What I'm failing to understand however, is how to use the package.xml file that Umbraco creates in my Nuget package. I've created a package in my Umbraco installation and ticked the document types and data types that I want to export and it gives me the following XML file:
All looking good I think. My question is, how do I get this in my Nuget package and get the doc types to install when running install-package papermoon.umbraco.umbracorssfeeds?
I've set up using Grunt following a couple of tutorials and guesswork. My package.json file looks like this:
Unfortunately not, I don't think there's a way to do this without rolling out your own code.
In the end, I ended up doing this using the various services that Umbraco provides. I set up a few factories that would get auto-detected on first boot and run - this is a pretty old post so I'm not sure that I have the code.
In Umbraco 8, I've got a small proof of concept which I've set up to allow me to create documents using a package.manifest file but ultimately it's the same set up, I have some code on startup that reads the file. This then uses Umbraco's services to create the content types etc.
there is no nativ way of installing things from the package.xml when you install a nuget package. The way is mostly to write some code that runs on startup and install it either via the services or using the actual package installer which both is not quite trivial.
Creating a Nuget Package with Document Types
Hi,
I've been attempting to set up a simple package for Umbraco which creates a few document types and data types. It also has a few classes to do a bit of heavy lifting.
However, what I'd ideally like to do is create a Nuget package so that I can easily install and update the extension. I've managed to get a set up working for me that creates the Nuget package (along with a zip, and the actual Umbraco package itself). This appears to be working for my bin file - the dll is copied across and I can using the namespaces in my other test project.
What I'm failing to understand however, is how to use the
package.xml
file that Umbraco creates in my Nuget package. I've created a package in my Umbraco installation and ticked the document types and data types that I want to export and it gives me the following XML file:All looking good I think. My question is, how do I get this in my Nuget package and get the doc types to install when running
install-package papermoon.umbraco.umbracorssfeeds
?I've set up using Grunt following a couple of tutorials and guesswork. My
package.json
file looks like this:And my
gruntfile.js
:This all works nicely but as I said, I just can't get my head around how to make use of the
package.xml
file.Has anyone done this? Any suggestions? Any and all help would be massively appreciated!
Even if you've not done the automated part, just figuring out where the xml should go would out me on the right track I think.
Thanks
Ben
HI Ben,
Have you ever found a solution to this? We're trying to do the same thing, and not really finding much success...
Thanks, Gabor
Hi Gabor,
Unfortunately not, I don't think there's a way to do this without rolling out your own code.
In the end, I ended up doing this using the various services that Umbraco provides. I set up a few factories that would get auto-detected on first boot and run - this is a pretty old post so I'm not sure that I have the code.
In Umbraco 8, I've got a small proof of concept which I've set up to allow me to create documents using a
package.manifest
file but ultimately it's the same set up, I have some code on startup that reads the file. This then uses Umbraco's services to create the content types etc.Thanks,
Ben
Hi Gabor,
there is no nativ way of installing things from the package.xml when you install a nuget package. The way is mostly to write some code that runs on startup and install it either via the services or using the actual package installer which both is not quite trivial.
For example the articulate package does something like this: https://github.com/Shazwazza/Articulate/blob/919122cc0d630704e6e240b6ffe2e4ec034f3717/src/Articulate/Packaging/ArticulateDataInstaller.cs
Regards David
is working on a reply...