Patrik Gustafsson Patrik Gustafsson - 1 month ago 15
ASP.NET (C#) Question

How to create a package for Umbraco with Visual Studio?

How do I create a package for Umbraco inside Visual Studio? I know that you can create a package inside Umbracos backoffice, but I am not interested in that right now. I just need something simple, like a hello world package

Answer

Unfortunately, it's not so simple. It depends what is going to be the package content. If those will be static files, dlls etc. - it's a job for MsBuild and you can use it to gather all the required files and create a package or even distrubute it.

There's a great article by Jeavon Leopold on 24days.in: http://24days.in/umbraco/2014/packaging-with-appveyor/ combined with CI done with AppVeyor.

The challange starts when you want to include document types, datatypes or any other Umbraco-related content there too. And this is really easy to be done with Umbraco Packaging through the backoffice (you just need to select what should be included). Using your custom build and automatic packaging, you need to remember that if anything should be included inside the Umbraco backoffice, it needs to be handled by the creation of those objects in your code (e.g. on application startup events custom handlers) and ensure that if it's not exist it should be re-created etc.

Personally, I suggest you to check how other package creators are handling it, as a lot of packages is open-sourced e.g:

etc.