目前我正在开发一个 NAnt 脚本来构建一个 Windows 窗体应用程序。构建 NAnt 脚本后,我收到错误消息
错误 CS0246:找不到类型或命名空间名称“Form1”(您是否缺少 using 指令或程序集引用?)
构建失败
C:\Program Files\NAnt\examples\SampleWindowsApplication\Sample.Build(24,10): External Program Failed: C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe(返回码为 1)” </p>
任何人都可以建议解决这个问题吗?
请在下面找到我的代码。
<?xml version="1.0"?>
<project name="SampleWindowsApplication" default="run">
<property name="basename" value="SampleWindowsApplication"/>
<property name="debug" value="true"/>
<target name="clean">
<delete>
<fileset>
<include name="bin/${basename}-??.exe"/>
</fileset>
</delete>
</target>
<target name="build">
<mkdir dir="bin" />
<assemblyfileset id="Sample.assemblies">
<include name="C:\Program Files\NAnt\examples\SampleWindowsApplication\SampleWindowsApplication\Assemblies\Sam.Grid.Base.dll" />
<include name="C:\Program Files\NAnt\examples\SampleWindowsApplication\SampleWindowsApplication\Assemblies\Sam.Grid.Windows.dll" />
<include name="C:\Program Files\NAnt\examples\SampleWindowsApplication\SampleWindowsApplication\Assemblies\Sam.Shared.Base.dll" />
<include name="C:\Program Files\NAnt\examples\SampleWindowsApplication\SampleWindowsApplication\Assemblies\Sam.Shared.Windows.dll" />
<!--<include name="C:\Program Files\NAnt\examples\SampleWindowsApplication\SampleWindowsApplication\Assemblies\System.Windows.Forms.dll" />-->
</assemblyfileset>
<csc target="exe" output="bin/${basename}.exe" debug="${debug}" >
<references refid="Sample.assemblies" />
<resources>
<include name="C:\Program Files\NAnt\examples\SampleWindowsApplication\SampleWindowsApplication\licenses.licx"/>
</resources>
<sources>
<include name="C:\Program Files\NAnt\examples\SampleWindowsApplication\SampleWindowsApplication\Program.cs"/>
</sources>
</csc>
</target>
<target name="run" depends="build">
<exec program="bin/${basename}-cs.exe" basedir="."/>
</target>
</project>
提前致谢。