6

I have an include file to remove the annoying Commerce License Warning on 8.1 update 3. But the patch file fails to load in. The log files show the following error:

"860 10:07:58 ERROR Could not load configuration file: [file location]: System.Exception: Reader is in incorrect state"

This is the patch file:

<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
    <!--
    Fixes: Missing Sitecore.Commerce.Connect licenses message in Content Editor - kb article 852031
    Link: https://kb.sitecore.net/articles/852031

    If you do not have keys for the Sitecore.Commerce.Connect or Sitecore.Commerce.ConnectPartner modules in your license file, the following message may be displayed above the "Quick info" section when opening the Content Editor:

        You require one of the following licenses to use the Sitecore Commerce Connect module.
        "Sitecore.Commerce.Connect" or "Sitecore.Commerce.ConnectPartner"

    These license keys are not included by default.
    -->
    <sitecore>
        <pipelines>
            <getContentEditorWarnings>
                <processor type="Sitecore.Commerce.Pipelines.ContentEditorLicenseWarning, Sitecore.Commerce">
                    <patch:delete />
                </processor>
            </getContentEditorWarnings>
        </pipelines>
    </sitecore>
</configuration>

A more annoying aspect is that on my local dev environment this patch files works fine. But when deployed it does not!

2

You can also move the comment to in between the xml and configuration node, or anywhere else within the sitecore node, and it should be fine

This is how a lot of the default example Sitecore configuration files have their comments:

<?xml version="1.0"?>
<!--
    Purpose: **** Comments here are fine ****
-->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
    <sitecore>
        <pipelines>
            <getContentEditorWarnings>
                <!-- **** Comments here are also fine **** -->
                <processor type="Sitecore.Commerce.Pipelines.ContentEditorLicenseWarning, Sitecore.Commerce">
                    <patch:delete />
                </processor>
            </getContentEditorWarnings>
        </pipelines>
    </sitecore>
</configuration>
  • Yeah that's what I ended up doing. Just a really dumb error! – Richard Seal Oct 4 '16 at 15:37
4

Found the issue - all files had the <sitecore> node in. But it seems like the comment that came before the <sitecore> node in the include file was causing the error in the logs.

When I removed the comment, the error went away! That patching code must be interesting!

<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
    <sitecore>
        <pipelines>
            <getContentEditorWarnings>
                <processor type="Sitecore.Commerce.Pipelines.ContentEditorLicenseWarning, Sitecore.Commerce">
                    <patch:delete />
                </processor>
            </getContentEditorWarnings>
        </pipelines>
    </sitecore>
</configuration>
  • Out of curiosity, what was the exact comment? – Thomas D Oct 4 '16 at 15:05
  • Updated the original question with the actual comment. Just references the KB article that lead to the patch file. – Richard Seal Oct 4 '16 at 15:17
  • Move the comment to inbetween the xml and configuration node, or anywhere else within the sitecore node and it should be fine. – jammykam Oct 4 '16 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.