#1
|
|||
|
|||
What am I doing wrong with Logging?
Hi,
I'm trying to do a simple build with one master build script. However, when I transform the XML log into a HTML log and try to send it out in email I keep getting this: Building project step 'Process Build Log and notifications'... Building project step 'Transform XML Log'... Closing any open log tags... Loading XML input document... Error at line 17301, position 2 loading 'C:\DOCUME~1\build\LOCALS~1\Temp\bld15A.tmp': Only one top level element is allowed in an XML document. I've experimented and I can't find a reason for this failure. I just tweak until it seems to work, then it works a few times and then fails again. What do I need to do in the simplest case to get this to work? I've attached a simple build file that fails for me. |
#2
|
|||
|
|||
I'm not able to reproduce this behavior with the attached sample. Which version of VBP are you running?
|
#3
|
|||
|
|||
I'm using version 5.7.
Let's start with the settings I should have checked or unchecked in the applicable dialogs in VBP. |
#4
|
|||
|
|||
The only one that would come into play is Tools | Application Options | Logging | Format (obviously would need to be XML). Do you have any errors from VBP in your Event Viewer (Application node)?
|
#5
|
|||
|
|||
The times that I have seen this error is when I am attempting to delete some files as part of the build script and delete the build's log file in the process. This deletes the starting XML tags that were already written to the log file before the file was deleted.
|
#6
|
|||
|
|||
I don't see any errors in the log. I'm only delete files at the beginning of the run when I delete the source files before getting them fresh from the repository.
I have another build that has been running for months fine. I went to set this one up and am having this problem. I can't find out what is different between the two. |
#7
|
|||
|
|||
Can you start fresh by deleting the log file, then when it happens again, ZIP and send the log file to support@kinook.com? Thanks.
|
#8
|
|||
|
|||
I'm not sure I can send the log file since it could contain sensitive information about what comprises our product. I'm afraid if I did a search and replace I might accidentally mess up the log and make it look like that was the problem instead of what is the real problem.
Can I debug or validate the buid file or log somehow? |
#9
|
|||
|
|||
Not really (other than possibly using FileMon [1] or something like it). It doesn't seem like there would be anything sensitive building the sample you attached in the original message. And we will use the log file only for diagnostic purposes and destroy it afterwards.
[1] http://www.sysinternals.com/ntw2k/source/filemon.shtml |
#10
|
|||
|
|||
Quote:
I'll try to look at it as best I can and let you know. |
#11
|
|||
|
|||
I saw this problem when I used DataTime() in the log file name. Each time an entry needed to be written to the log, the DateTime() was recalculated and a new file was created.
|
#12
|
|||
|
|||
The value of the vbld_FormatDateTime system script function will change every second, and if the LOGFILE macro references these, since they are evaluated each time the macro is referenced, that will be a problem (the log filename will change every second).
To use the starting date+time value for the log filename for the entire build, assign the expanded value to a temporary LOGFILE macro in the project's vbld_BuildStarting script event: Code:
Function vbld_BuildStarting() ' remove temp macro in case it already exists (to avoid recursion) vbld_TempMacros().Remove "LOGFILE" ' store the expanded value of the current LOGFILE project/global macro ' (possibly containing a date+time value) so that the log filename ' will remain the same for the entire build vbld_TempMacros().Add "LOGFILE", Application.ExpandMacrosAndScript("%LOGFILE%") End Function |
|
|