Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Sotiris Filippidis 283 posts 1497 karma points
    Sep 07, 2022 @ 14:31
    Sotiris Filippidis

    Nuget Package with AutomaticMigrationPlan failing to get embedded package.xml file

    I recently tried to create a Nuget package which had the sole purpose of creating some doctypes on the target installation. For testing purposes, I created a "dummy" doctype without any dependencies in an existing Umbraco setup, got the package.xml file and went on to create an automatic package migration as described here:

    When I try to install the package on a new Umbraco site, though, I get the message "Missing embedded files for planType:" - I made sure I had included the package.xml file as an embedded resource, and also made a zip and added that as well. I can't make it work.

    I even switched to a custom migration - this time it was set up, but during running the new Umbraco site I got an "object reference not set to an instance of an object". Again, it seemed like it couldn't find the embedded resource.

    What am I missing? I have seen others doing the same (searched for code on GitHub) in exactly the same way. Must be something extremely silly!

  • Sotiris Filippidis 283 posts 1497 karma points
    Sep 08, 2022 @ 21:05
    Sotiris Filippidis

    Answering my own question here since I've probably spotted what is wrong:

    I was trying to set up the package together with installing a new umbraco instance, i.e.

    dotnet new umbraco -n somename -p mypackageid

    But this would cause issues. Reason unknown.

    When I set up the package in a private feed and set it up on an existing Umbraco installation from the command line (dotnet add package) everything went smoothly.

    So setting up a package together with an Umbraco installation probably has some issues when the package has migrations? Can't find any other explanation.

  • Emma Garland 39 posts 120 karma points MVP 5x c-trib
    18 days ago
    Emma Garland


    I just came across the same issue when trying to do:

    dotnet new umbraco -n ProjectXYZ -p PRPackageXYZ

    I debugged it and it seems like the issue (for me, anyway) is that it is expecting a, but I only had a package.xml file because I didn't have any content or media etc, just a doctype and composition.

    I got around it by:

    1. Changing it to a in the package project
    2. Making that the embedded resource
    3. Repacking the package

    The issue seems to be in ..\Umbraco.Core\Packaging\PackageMigrationResource.cs line 31 GetEmbeddedPackageZipStream method.

    It turns out there is an existing issue that I think covers this at

    Thanks for sharing the post


Please Sign in or register to post replies

Write your reply to: