nick macdonald
nick macdonald

Reputation: 73

The Fragment element contains an unhandled extension element 'util:XmlFile'

I am writing a setup project for wix v3 in visual studio. The purpose of the project is to install a bunch of files to certain directories and then alter an XML file by setting values for elements. Everything builds fine until I add the XmlFile element to edit the XML file. Here is a code snippet of the element:

<Fragment>
    <util:XmlFile
        File="[INSTALLDIR]⁄Server/MEScontrol.config"  
        Id="config"  
        Action="setValue"
        Name="connectionString"                             
        ElementPath="⁄MEScontrol⁄DatabaseServer⁄Package[\[]@name='core'[\]]/add[[]@Assembly[\]]"
        Value="[\[]@name='BINGBONG'[\]]" />
</Fragment>

The error I get when building is this:

"The Fragment element contains an unhandled extension element 'util:XmlFile'. Please ensure that the extension for elements in the 'http:⁄⁄schemas.microsoft.com⁄wix⁄UtilExtension' namespace has been provided"

I know that I need to add the namespaces xmlns="http://schemas.microsoft.com/wix/2006/wi" and xmlns:util="http://schemas.microsoft.com⁄wix⁄UtilExtension" to my code and then add the reference WixUtilExtension to the project, which I have done, but I still get this error when building. Is it possible that I miss something in my code or references? I have also tried adding the util:XmlFile element as a Component inside my Directory structure but still the same error

Upvotes: 0

Views: 304

Answers (1)

nick macdonald
nick macdonald

Reputation: 73

Don't worry everybody I figured it out almost as soon as i posted this question. Apparently the "/" I was using in the namespace was not actually the correct character for a URL and that was causing the error. Silly me

Upvotes: 2

Related Questions