#136 MSI - System.InvalidCastException

open
nobody
Tasks (69)
5
2008-07-23
2008-07-23
Austin Hastings
No

I am experimenting with the MSI task, and with a fairly rudimentary configuration I get a strange error: unable to cast object of type ... to type ... -- it's trying to cast an object to its own type? Huh?

Anyway, the output is here, and the sample project follows.

NAnt 0.86 (Build 0.86.2898.0; beta1; 12/8/2007)
Copyright (C) 2001-2007 Gerry Shaw
http://nant.sourceforge.net

Buildfile: file:///[ELIDED]/test.build
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: test

test:

BUILD FAILED

INTERNAL ERROR

System.InvalidCastException: Unable to cast object of type 'NAnt.Contrib.Schemas.Msi.msi' to type 'NAnt.Contrib.Schemas.Msi.msi'.
at NAnt.Contrib.Tasks.Msi.MsiTask.Initialize() in d:\Source\nantcontrib-20071201T202638Z\src\Tasks\Msi\MsiTask.cs:line 377
at NAnt.Core.Element.Initialize(XmlNode elementNode, PropertyDictionary properties, FrameworkInfo framework)
at NAnt.Core.Project.CreateTask(XmlNode taskNode, Target target)
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()

Please send bug report to nant-developers@lists.sourceforge.net.

Total time: 0.7 seconds.

==========
<?xml version="1.0"?>
<project name = "test" default = "test">
<target name = "test">
<property name = "msi-contents"
value = "C:\...\Deployment" />
<msi
output = "test.msi"
sourcedir = "${msi-contents}"
>
<components>
<component name = "MainFiles"
id="{6C0BD094-FE56-448B-B35A-5AF6E42EFA63}"
attr = "2"
directory = "TARGETDIR"
feature = "MAIN"
keepsubdirs = "true"
>
<key file = "Global.asax" />
<fileset basedir = ".">
<include name = "**/*" />
</fileset>
</component>
</components>
<features>
<feature name = "MAIN"
display = "1"
title = "Main Feature"
typical = "true"
directory = "TARGETDIR"
attr = "2"
>
</feature>
</features>
</msi>
</target>
</project>

Discussion