Copied to clipboard

Flag this post as spam?

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


  • William Rees 1 post 71 karma points
    Apr 29, 2020 @ 00:04
    William Rees
    0

    Error executing custom package action on install

    I've created a package with a custom action but when I look at the logs after installing the package I see the error

    Could not add package actions to the package xml definition, the xml did not parse

    with this stack trace

    System.Xml.XmlException: There are multiple root elements. Line 1, position 21.\r\n at System.Xml.XmlTextReaderImpl.Throw(Exception e)\r\n at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)\r\n at System.Xml.XmlTextReaderImpl.ParseDocumentContent()\r\n at System.Xml.XmlTextReaderImpl.Read()\r\n at System.Xml.Linq.XElement.ReadElementFrom(XmlReader r, LoadOptions o)\r\n at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)\r\n at System.Xml.Linq.XElement.Parse(String text, LoadOptions options)\r\n at System.Xml.Linq.XElement.Parse(String text)\r\n at Umbraco.Core.Packaging.PackageDefinitionXmlParser.ToXml(PackageDefinition def) in D:\a\1\s\src\Umbraco.Core\Packaging\PackageDefinitionXmlParser.cs:line 62

    The install shows as successfully completed but my custom action was not executed. Below is the package config (with somethings removed for clarity). Any assistance would be great

    <?xml version="1.0" encoding="utf-8"?>
    <umbPackage>
      <files>
        <!-- I DELETED THE FILES AS IT WAS TOO LONG -->
      </files>
      <info>
        <package>
          <name>Company.Umbraco.Core</name>
          <version>4.0.0</version>
          <iconUrl></iconUrl>
          <license url="http://opensource.org/licenses/MIT">MIT License</license>
          <url>https://company.com/umbraco/packages/core</url>;
          <requirements type="Strict">
            <major>8</major>
            <minor>5</minor>
            <patch>4</patch>
          </requirements>
        </package>
        <author>
          <name>Company</name>
          <website>https://company.com</website>;
        </author>
        <contributors>
          <contributor>WR</contributor>
        </contributors>
        <readme><![CDATA[]]></readme>
      </info>
      <DocumentTypes />
      <Templates />
      <Stylesheets />
      <Macros>
        <!-- I DELETED THE MACROS AS IT WAS TOO LONG -->
      </Macros>
      <DictionaryItems>
       <!-- I DELETED THE DICTIONARY ITEMS AS IT WAS TOO LONG -->
      </DictionaryItems>
      <Languages>
        <Language Id="1" CultureAlias="en-US" FriendlyName="English (United States)" />
      </Languages>
      <DataTypes />
      <Actions>
        <Action runat="install" alias="CustomInstall" />
      </Actions>
    </umbPackage>
    
  • Martin Damm 4 posts 93 karma points
    Oct 09, 2020 @ 09:13
    Martin Damm
    0

    I ran into the same problem.

    I took a look at the installedPackages.config file in App_Data/packages and noticed how every element is lowercase, which made me wonder if the documentation is wrong (I have my suspicions). So I tried writing my action with lowercase despite what the documentation says, and I tried writing them with capitalisation, but nothing works. I think the key is figuring out why it fails parsing the XML. Everything but the actions seems to parse just fine.

    If I manage to solve this I'll get back with an answer.

  • Jorge Ribeiro 29 posts 213 karma points
    Dec 29, 2020 @ 02:11
    Jorge Ribeiro
    0

    Got same error... gess you didn't solve it yet...

    I get the same warning but in my case custom actions are executed. Installedpackages.config however has actions element empty

Please Sign in or register to post replies

Write your reply to:

Draft