Amol
Amol

Reputation: 21

Error reading WiX .wxs file

I am trying to read a WiX .wxs file as follows:

      XDocument xmlFile = XDocument.Load(outputWxsFile);

I get the following exception :

'<', hexadecimal value 0x3C, is an invalid attribute character. Line 6, position 9.

The file I am reading is a Windows Installer XML (WiX) .wxs file which starts as shown below.

How can I read .Wxs files which are XML files?

I need to read and replace attribute values.

<?xml version="1.0" encoding="utf-8"?><Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="{E8E428E3-4828-46D5-B8CF-1F0C23B9420F}" Codepage="1252" Language="1033" Manufacturer="tempe" Name="temp" UpgradeCode="{4FB04FA2-A01B-4AD2-A0BC-27371F71C989}" Version="1.0.0">
    <Package Compressed="yes" InstallerVersion="200" Languages="1033" Manufacturer="temper" Platform="x86" />
    <Binary Id="DefBannerBitmap" SourceFile="Binary/DefBannerBitmap.bmp />
    <Binary Id="UpFldrBtn" SourceFile="Binary/UpFldrBtn.bmp />
    <Binary Id="NewFldrBtn" SourceFile="Binary/NewFldrBtn.bmp />

......

Upvotes: 1

Views: 251

Answers (1)

mschenk74
mschenk74

Reputation: 3591

In your SourceFile="Binary/DefBannerBitmap.bmp you are missing the closing ". Therefore the < is parsed as part of an attribute name which leads to the misleading exception message. The same with all the following SourceFile statements. You could see this easily by looking at the colors of the syntax-highlighting, also.

Upvotes: 4

Related Questions