#696 Nant fails with internal error


We are experiencing build issues with Nant 0.85 when we add the solution file to Visual Source Safe 2005.

Basically all works fine until we add our .NET (C#) solution to source control. Once we do that and check out a copy for edit the build starts failing. A version of the solution with source control bindings removed works fine (no other difference between the 2 solutions - just one has VSS bindings and one does not.

Could this be a file / folder permissions issue? We have made sure that we check out all solution files for edit (make writable) before we attempt to run the build.


  • Dewi Felstead

    Dewi Felstead - 2009-01-17

    Log file showing build error.

  • steven maglio

    steven maglio - 2009-01-18

    I wrote a reply question to this before reading the build.log file (below).

    But after reading the log file I was curious as to the error statement, "System.Data.SqlClient.SqlException: Incorrect syntax near '4'."

    What does db.schema.reflect do? And is there any place in it's code that have the number 4?


    I'm not the developer of NANT (drieseng, http://www.ohloh.net/p/nant/contributors\), but I am curious that you mentioned permissions issues.

    Could you open a windows explorer window under the account that your nant script run's under to test the permissions?

    Our systems team showed me a way to use IE in order to do this:

    (In Windows XP/Server 2003)
    Start Menu > Programs > Internet Explorer (right click on this option and choose "Run As ...").
    Then log in with the account and in the location bar ...
    file:///<path to directory>
    example: file:///D:/Working_Area/felsteadd/Projects/TeamTrack

    When running under that account are you able to access the proper folders/files?

    (I sure hope this looks right. There doesn't seem to be a preview submission option on these replys.)

  • Dewi Felstead

    Dewi Felstead - 2009-01-18

    Hi, Thanks for the reply - the account use to run nant is a local admins account and using explorer all files can be accessed / viewed corrected. The db.schema.refelect target can be seen below:

    <target name="db.schema.reflect" depends="db.init, tasks.load">
    <mkdir dir="${db.schema.xml.dir}" unless="${directory::exists(db.schema.xml.dir)}" />

    <foreach item="File" property="query.file" in="${db.dir}\schema">
    <xmlsqlquery connection="Data Source=${ini.dbserver}; Initial Catalog=${ini.dbname}; Integrated Security=SSPI"
    out="${db.schema.xml.dir}\${path::get-file-name-without-extension(query.file)}.xml" />

    <exec program="${ini.msbuildpath}">
    <arg value="${build.rel.path}\Database.proj" />
    <arg value="/t:AfterBuild" />
    <arg value="/p:TargetServer=${ini.dbserver}" />
    <arg value="/p:TargetDatabase=${ini.dbname}" />

    As I mentioned in my initial post the whole thing works fine until I add the solution to source control using VSS. After that the db.schema.reflect bit fails consistently - I have identified that commenting out the foreach loop enables to the build to succeed but then files are missing that are required to build to solution file.

  • steven maglio

    steven maglio - 2009-01-18

    Hmmm ... That's very interesting. Because the <foreach> loop is the one that causes the problem it makes me think that the <xmlsqlquery> statement is the task which is causing the problem.

    Unfortuanelty, I have never seen that task before. Is it part of the nant-extensions package? I haven't really used that package before.

    I'm about to crawl into bed. I'll try to look into this more tomorrow.

    I may be distracted. I'm working on a Unity project at the moment, and I have found speedbumps (http://www.codeplex.com/unity/SourceControl/PatchList.aspx).

  • Gert Driesen

    Gert Driesen - 2009-01-18

    Hi Dewi,

    Your build log clearly shows that the error is caused by the XmlSqlQueryTask.
    The input file that it uses - and that was generated earlier on in the build? - apparently causes a SQL error.

    It is only reported as an INTERNAL ERROR because that task does not perform error handling, and as such the exception bubbles up to NAnt.

  • Gert Driesen

    Gert Driesen - 2009-01-18
    • labels: 513583 --> Third party libraries
    • assigned_to: nobody --> drieseng
    • status: open --> closed-invalid
  • Dewi Felstead

    Dewi Felstead - 2009-01-19


    May thanks for your comments - we have resolved the issue. Bascially the script fails when the code is added to VSS because when it iterates through files using the foreach look it comes across a VSS hidden / System / Readonly file (vssver2.scc). The script assumes this file was also containing SQL to execute against the database and was causing the failure. We simply needed to add a check within the foreach look to ensure vssver2.scc was not processed.


  • Gert Driesen

    Gert Driesen - 2009-01-19

    I've now added vssver2.scc to our list of default includes.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks