J
Jon Maz
Hi All,
To allow myself to make development changes directly on a remote server
*without* having to compile on my local dev machine and then upload the
dll's to remote, I have created a RunBatch.aspx on the remote which calls a
batch file (myBuild.bat) on the same machine, and this batch file executes
the necessary command-line compiler instructions to recompile (code below).
So far (fingers crossed) it seems to be working. The only thing I'm
missing, but would really like access to, is any compiler error messages
that may arise. Does anyone have any ideas how RunBatch.aspx could get hold
of those error messages from csc.exe (or from cmd.exe, I'm not actually
entirely sure where they are), and print those out to the screen?
Thanks!
JON
PS No Visual Studio in this setup, before anyone asks!
**************
RunBatch.aspx
**************
Process myProcess = new Process();
myProcess.EnableRaisingEvents = true;
myProcess.StartInfo.FileName = @"c:\Inetpub\wwwroot\myBuild.bat";
myProcess.StartInfo.WorkingDirectory = "C:/";
myProcess.StartInfo.Arguments = "file.txt -s -m";
myProcess.Start();
myProcess.WaitForExit();
Response.Write("myProcess.ExitCode: " + myProcess.ExitCode + "<br>");
************
myBuild.bat
************
REM Compile data layer
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe /t:library
/out:C:\Inetpub\wwwroot\myProject\myProject_data\obj\myProject_data.dll
C:\Inetpub\wwwroot\myProject\myProject_data\*.cs /r:System.web.dll
/r:System.dll /r:System.Data.dll /r:System.Web.dll /r:System.XML.dll
REM Compile business layer
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe /t:library
/out:C:\Inetpub\wwwroot\myProject\myProject_business\obj\myProject_business.
dll C:\Inetpub\wwwroot\myProject\myProject_business\*.cs
/r:System.web.dll /r:System.dll /r:System.Data.dll /r:System.Web.dll
/r:System.XML.dll /r:System.XML.dll /r:myProject_data.dll
/lib:C:\Inetpub\wwwroot\myProject\myProject_data\obj\
REM Copy business & data dll's to pres layer bin folder
COPY C:\Inetpub\wwwroot\myProject\myProject_data\obj\myProject_data.dll
C:\Inetpub\wwwroot\myProject\myProject\bin\ /Y
COPY
C:\Inetpub\wwwroot\myProject\myProject_business\obj\myProject_business.dll
C:\Inetpub\wwwroot\myProject\myProject\bin\ /Y
REM Compile presentation layer
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe /t:library
/out:C:\Inetpub\wwwroot\myProject\myProject\bin\myProject.dll
/recurse:C:\Inetpub\wwwroot\myProject\myProject\*.cs
/r:System.web.dll /r:System.dll /r:System.Data.dll /r:System.Web.dll
/r:System.XML.dll /r:System.XML.dll /r:myProject_data.dll
/r:myProject_business.dll
/lib:C:\Inetpub\wwwroot\myProject\myProject_data\obj\,C:\Inetpub\wwwroot\myP
roject\myProject_business\obj\
To allow myself to make development changes directly on a remote server
*without* having to compile on my local dev machine and then upload the
dll's to remote, I have created a RunBatch.aspx on the remote which calls a
batch file (myBuild.bat) on the same machine, and this batch file executes
the necessary command-line compiler instructions to recompile (code below).
So far (fingers crossed) it seems to be working. The only thing I'm
missing, but would really like access to, is any compiler error messages
that may arise. Does anyone have any ideas how RunBatch.aspx could get hold
of those error messages from csc.exe (or from cmd.exe, I'm not actually
entirely sure where they are), and print those out to the screen?
Thanks!
JON
PS No Visual Studio in this setup, before anyone asks!
**************
RunBatch.aspx
**************
Process myProcess = new Process();
myProcess.EnableRaisingEvents = true;
myProcess.StartInfo.FileName = @"c:\Inetpub\wwwroot\myBuild.bat";
myProcess.StartInfo.WorkingDirectory = "C:/";
myProcess.StartInfo.Arguments = "file.txt -s -m";
myProcess.Start();
myProcess.WaitForExit();
Response.Write("myProcess.ExitCode: " + myProcess.ExitCode + "<br>");
************
myBuild.bat
************
REM Compile data layer
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe /t:library
/out:C:\Inetpub\wwwroot\myProject\myProject_data\obj\myProject_data.dll
C:\Inetpub\wwwroot\myProject\myProject_data\*.cs /r:System.web.dll
/r:System.dll /r:System.Data.dll /r:System.Web.dll /r:System.XML.dll
REM Compile business layer
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe /t:library
/out:C:\Inetpub\wwwroot\myProject\myProject_business\obj\myProject_business.
dll C:\Inetpub\wwwroot\myProject\myProject_business\*.cs
/r:System.web.dll /r:System.dll /r:System.Data.dll /r:System.Web.dll
/r:System.XML.dll /r:System.XML.dll /r:myProject_data.dll
/lib:C:\Inetpub\wwwroot\myProject\myProject_data\obj\
REM Copy business & data dll's to pres layer bin folder
COPY C:\Inetpub\wwwroot\myProject\myProject_data\obj\myProject_data.dll
C:\Inetpub\wwwroot\myProject\myProject\bin\ /Y
COPY
C:\Inetpub\wwwroot\myProject\myProject_business\obj\myProject_business.dll
C:\Inetpub\wwwroot\myProject\myProject\bin\ /Y
REM Compile presentation layer
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe /t:library
/out:C:\Inetpub\wwwroot\myProject\myProject\bin\myProject.dll
/recurse:C:\Inetpub\wwwroot\myProject\myProject\*.cs
/r:System.web.dll /r:System.dll /r:System.Data.dll /r:System.Web.dll
/r:System.XML.dll /r:System.XML.dll /r:myProject_data.dll
/r:myProject_business.dll
/lib:C:\Inetpub\wwwroot\myProject\myProject_data\obj\,C:\Inetpub\wwwroot\myP
roject\myProject_business\obj\