我如何使用Nant(0.86)将.NET 3.5类库编译为DLL文件?
目前为止,这是我所拥有的:
我如何在GAC中引用系统的DLL?这行代码似乎不起作用。
<include name="System.ComponentModel.DataAnnotations.dll"/>
这是我的脚本:
<?xml version="1.0"?>
<project name="MyCorp.Data" default="all">
<property name="debug" value="true" />
<target name="all"/>
<target name="clean" description="remove all build products">
<delete dir="build" if="${directory::exists('build')}" />
</target>
<target name="init">
<mkdir dir="build" />
</target>
<target name="compile"
depends="init"
description="compiles the application">
<csc target="library" output="build\${project::get-name()}.dll" debug="${debug}">
<sources>
<include name="src\MyCorp.Data\**\*.cs" />
</sources>
<references>
<include name="tools\subsonic\subsonic.dll"/>
<include name="lib\log4net\log4net.dll"/>
<include name="System.ComponentModel.DataAnnotations.dll"/>
</references>
</csc>
</target>
</project>
我通过使用JP Boodhoo的文章实现了这一步骤。