如何正确使用Nant来构建和部署使用asp.net、vb.net和.net Framework1.1开发的asp.net项目?
我尝试使用这个构建文件:
<?xml version="1.0" ?>
<project name="MyWebProj" default="build" basedir=".">
<description>...</description>
<property name="debug" value="true" overwrite="false"
/>
<property name="basename" value="MyWebProj" />
<target name="build">
<mkdir dir="NantBIN" />
<vbc target="library" output="NantBIN/${basename}.dll" debug="${debug}">
<sources>
<include name="*.vb" />
</sources>
</vbc>
</target>
</project>然后我运行这个bat文件:
@echo off bin\nant -t:net-1.1 -buildfile:.MyWebProjPath pause发布于 2012-10-09 21:27:48
首先,感谢您的回答和建议。这就是我最终解决问题的方法。我使用下面的代码作为构建文件:
<?xml version="1.0"?><project name="..." default="rebuild" basedir=".">
<target name="rebuild" depends="build">
<call target="build.copy"/>
</target>
<target name="build" description="Build all targets.">
<call target="build.project"/>
</target>
<target name="build.project">
<solution configuration="${configuration}" solutionfile="${solutionName}" outputdir="${expected.output}">
<webmap>
<map url="${webproj.url}" path="${webproj.name}" />
</webmap>
</solution>
</target>
<target name="build.copy">
<copy todir="${path.to.deploy}" overwrite="true">
<fileset basedir=".">
...
<include name="**\*.asp" />
<include name="**\*.aspx" />
<include name="**\*.css" />
<include name="**\*.js" />
...
</fileset>
</copy>
</target>
然后我运行这个bat文件(设置-t:net-1.1以指定.net框架版本非常重要):
bin\nant -t:net-1.1 -buildfile:.MyWebProjPath发布于 2012-10-05 18:39:07
你可以参考下面的链接,它为你解释了一步一步的过程。
http://www.codeproject.com/Articles/123713/Automate-Publishing-a-WebSite-into-IIS-using-MSDep
http://www.4guysfromrolla.com/articles/120104-1.aspx
https://stackoverflow.com/questions/12744321
复制相似问题