<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="ltr">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
  <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
  <title>Compile</title>
  <xml></xml>
  <link rel="stylesheet" type="text/css" href="MSDN.css">
</head>
<body id="bodyID" class="dtBODY">
<div id="nsbanner">
<div id="bannerrow1">
<table class="bannerparthead" cellspacing="0">
          <tbody>
    <tr id="hdr">
            <td class="runninghead">
      <p align="left">CS-Script 3.27.0</p>
            </td>
            <td class="product">
            </td>
          </tr>
  </tbody>
</table>
      </div>
<div id="TitleRow">
<h1 class="dtH1" align="left">Compile to
executable&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</h1>
      </div>
    </div>
<div id="nstext">
<p><span style="font-weight: bold;">/e</span> - compiles script into console application executable&nbsp;</p>
<div style="margin-left: 40px;" class="syntax"> cscs /e test </div>
<div style="margin-left: 40px;">The command above compiles script <i> test.cs</i> into console application
executable <i>test.exe</i>. Location of the executable is the same as location
of the script file.<br>
</div>
<p>
<br>
</p>
<p><span style="font-weight: bold;">/ew</span> - compiles script into Windows application executable&nbsp;</p>
<div style="margin-left: 40px;" class="syntax"> cscs /ew test </div>
<div style="margin-left: 40px;">The command above compiles script <i> test.cs</i> into Windows application
executable <i>test.exe</i>. Location of the executable is the same as location
of the script file. <br>
</div>
&nbsp;
<h4 class="dtH4">Note:</h4>
<p>During script excution&nbsp;the script engine helps CLR to locate
all referenced assemblies, which are not in the 'current
directory'&nbsp;or GAC. Such assemblies may come&nbsp;from&nbsp;the
Default (<a href="Integration_with_OS.html"><span style="font-style: italic;">%CSSCRIPT_DIR%\Lib</span></a>) or Custom (<a href="Config.html">SearchDirs</a>)
Script Library directory(s). If compiled script (*.exe) executed any
assemblies from Script Library directories&nbsp;will not be found by
CLR (because the execution is not&nbsp;conducted under the CS-Script
environment). Thus in order to execute compiled script (*.exe) all
referenced assemblies must be located either in GAC or to be in the
same folder where the executable file is.&nbsp;</p>
<h4 class="dtH4">See Also</h4>
<p>
        <a href="Command-line_Interface.html">Command-line interface</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" viewastext="true" style="display: none;">
	<param name="Keyword" value="Compile">
</object>
    </div>
</body>
</html>

