I had similar issues trying to set this up.  In IIS, I needed to
configure the site (or virtual directory) running the ASP.NET page to a
new Application Pool.  I set the credentials of that App Pool to a user
that could successfully execute the nant script on the IIS machine (in
my case, the local administrator).

e


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Peter A.
Pociask
Sent: March 31, 2005 2:58 PM
To: nant-users@lists.sourceforge.net
Cc: nant-developers@lists.sourceforge.net
Subject: [Nant-users] Calling nant from asp.net web page

I am trying to call nant from an asp.net (vb.net) web application. I am
using the following code:

    Public Function compile(ByVal compileArg) As String

        Dim args As String
        args += " -f:" &
ConfigurationSettings.AppSettings("nantBuildFile")
        args += " " & compileArg

        'Response.Write(args)
        Dim proc As New System.Diagnostics.Process
        proc.StartInfo.WorkingDirectory = "d:\"
        proc.StartInfo.RedirectStandardOutput = True
        proc.StartInfo.RedirectStandardError = True
        proc.StartInfo.FileName =
ConfigurationSettings.AppSettings("nantBin") & "nant.exe"
        proc.StartInfo.Arguments = args
        proc.StartInfo.UseShellExecute = False
        proc.Start()

        'Response.Write("Output " & proc.StandardError.ReadToEnd &
"<BR>")
        Dim out = proc.StandardOutput.ReadToEnd

        proc.WaitForExit()
        proc.Dispose()

        Return out
    End Function

I am attempting to execute a build script that works fine when invoked
from the command line, but it fails miserably when called from the web
page. It returns a bunch of lines that look like the following:

 [delete] Deleting file FILE.
  [foreach] D:\ServerConf\default.build(32,6):
  [foreach] Cannot delete file FILE
  [foreach]     Invalid File or Directory attributes value.

I am almost certain it is some sort of permissions issue, but I'm not
sure what nant needs to run in terms of environment variables and temp
space. Has anyone attempted this, and if so, could you give me some
guidance? 

(Sorry for the cross post, I wasn't sure if this was a user or developer
question)

Peter Pociask


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide Read honest & candid
reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=ick
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to