OK. Note that there are different ways to set up the compile
instructions, and I have seen examples that do things a little
differently, but I'll explain the commands so that you know why I set
things up this way.
First, I created an ASCII text file with a .bat file extension. It might be named something like CompileAll.bat
Then, in this particular application, I have added the following text to the file:
set indir1=C:\Inetpub\wwwroot\JBSurvey\source\JBSurvey.cs
set indir2=C:\Inetpub\wwwroot\JBSurvey\source\Login.cs
set outdir=C:\Inetpub\wwwroot\JBSurvey\bin\JBSurvey.dll
set assemblies=System.dll,System.Data.dll,System.Web.dll,System.Xml.dll
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\csc /target:library /out:%outdir% %indir1% %indir2% /r:%assemblies% /optimize
pause
When I want to compile the application, I simply find the .bat file in
Windows Explorer and double-click on the file icon in the same manner
that I might run an executable file.
In the first two lines I am defining the list of input files that I
want to be included in the compilation. In the third line, I am
setting the output directory and filename for the compiled dll
file. In the fourth line, I am defining the .NET assemblies that
are required for the application, given the namespaces that I use
within the application. These assemblies are not the same as
namespaces, and one assembly will contain multiple namespaces.
The line of code that actually calls the compiler is the fifth
line. In this case, I am calling the c-sharp compiler. You
will use vbc if you want to call the vb compiler. Note also that
I am using fully qualified directory paths. If you have .NET
version 2.0 installed, there will be a set of compilers in that
directory also, which you should use instead of the one shown above for
compiling v2.0 apps. The /target switch tells the compiler that I
want a dll instead of an exe. The /out switch sets the output and
input directories. The /r switch sets the assemblies. The
/optimize switch adds a code optimization check. Note the pause
command in the last line of code. You must include that so that
the command window will stay open, allowing you to determine whether
the compilation has been successful, or to read any error messages
provided by the compiler. If you don't have the pause command,
the command window will close immediately after the code has run,
regardless of whether it actually compiled anything.
best, jake