Title: System.IO.FileNotFoundException

Hi everybody,

I have a target that handles the "onsuccess" event.

It does simple things.

- Sets a Time Stamp to a property
- Runs a VB Script that generates an xml file
- Converts the xml to html via an xsl (using style)
- Stops the Recording Process
- Sends an email

However, I receive a "System.IO.FileNotFoundException" error during the VB script.  Weird enough, when I run the target directly, it works !

Here's the detail error and at the end, the Target:

INTERNAL ERROR
System.IO.FileNotFoundException: Could not find file "C:\DOCUME~1\calp01\LOCALS~
1\Temp\wg7me1ho.dll".
File name: "C:\DOCUME~1\calp01\LOCALS~1\Temp\wg7me1ho.dll"
   at System.IO.__Error.WinIOError(Int32 errorCode, String str)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFr
omProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share)
   at System.CodeDom.Compiler.CodeCompiler.FromFileBatch(CompilerParameters opti
ons, String[] fileNames)
   at System.CodeDom.Compiler.CodeCompiler.FromSourceBatch(CompilerParameters op
tions, String[] sources)
   at System.CodeDom.Compiler.CodeCompiler.FromSource(CompilerParameters options
, String source)
   at System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compiler.ICodeCompiler
.CompileAssemblyFromSource(CompilerParameters options, String source)
   at SourceForge.NAnt.Tasks.ScriptTask.ExecuteTask() in C:\_VStudio\SourceForge
\nant\nant\src\NAnt.Core\Tasks\ScriptTask.cs:line 180
   at SourceForge.NAnt.Task.Execute() in C:\_VStudio\SourceForge\nant\nant\src\N
Ant.Core\Task.cs:line 100
   at SourceForge.NAnt.Target.Execute() in C:\_VStudio\SourceForge\nant\nant\src
\NAnt.Core\Target.cs:line 149
   at SourceForge.NAnt.Project.Execute(String targetName) in C:\_VStudio\SourceF
orge\nant\nant\src\NAnt.Core\Project.cs:line 426
   at SourceForge.NAnt.Project.Run() in C:\_VStudio\SourceForge\nant\nant\src\NA
nt.Core\Project.cs:line 483
   at SourceForge.NAnt.ConsoleDriver.Main(String[] args) in C:\_VStudio\SourceFo
rge\nant\nant\src\NAnt.Core\ConsoleDriver.cs:line 250


        <target name="onSuccess" depends="Init">
                <tstamp property="build.end.date" verbose="true"/>
               
                <echo message="Generating the Result.xml via Script"/>
                <script language="VB" >
                        <code><![CDATA[
                                Public Shared Sub ScriptMain(project As Project)
                                        Dim oDOM As System.Xml.XmlDocument
                                        Dim oEl As System.Xml.XmlElement

                                        oDOM = New System.Xml.XmlDocument()

                                        oDOM.LoadXml("<Project/>")
                                        try
                                                oEl = oDOM.CreateElement("ProjectCode")
                                                oEl.InnerText = project.Properties("sys.env.ProjectCode")
                                                oDOM.DocumentElement.AppendChild(oEl)

                                                oEl = oDOM.CreateElement("ArchiveLoc")
                                                oEl.InnerText = project.Properties("sys.env.ArchiveLoc")
                                                oDOM.DocumentElement.AppendChild(oEl)

                                                oEl = oDOM.CreateElement("StartDate")
                                                oEl.InnerText = project.Properties("build.start.date")
                                                oDOM.DocumentElement.AppendChild(oEl)

                                                oEl = oDOM.CreateElement("EndDate")
                                                oEl.InnerText = project.Properties("build.end.date")
                                                oDOM.DocumentElement.AppendChild(oEl)

                                                oEl = oDOM.CreateElement("BuildVersion")
                                                oEl.InnerText = project.Properties("Project.Build.Version")
                                                oDOM.DocumentElement.AppendChild(oEl)
                                        Finally
                                                oDOM.Save("Result.xml")
                                        End Try
                                       
                                End Sub
                       
                        ]]></code>
                </script>
               
                <echo message="Converting the Result.xml using the xsl"/>
                <style style="GenericResult.xsl" in="Result.xml" out="Result.htm" />
       
                <record name="${logfile}" action="Close"/>

                <property name="BuildVersion" value="Not Set" />
                <mail
                        from="[EMAIL PROTECTED]"
                        tolist="[EMAIL PROTECTED]"
                        mailhost="localhost"
                        subject="[${sys.env.ProjectCode}] Build Successfull...   ${Project.Build.Version}!"
                        format="Html"
                        files="Result.htm"
                        failonerror="false"
                        attachments="VSSCheckedOut.log,${logfile}"
                />
                       
        </target>


Patrice Calvé
Développeur Sénior - Senior Software Developer
Cactus Communications Internet
376 boul. St. Joseph
Hull, QC
J8Y3Y7
( Phone: 819.778.0313                   1 Fax: 819.420.0121
+ E-mail:[EMAIL PROTECTED] & Web:www.cactus.ca
"3 kinds of people: those who can count & those who can't"

Reply via email to