2012-10-05 43 views
0

如何正確使用Nant構建和部署使用asp.net,vb.net和.net framework 1.1開發的asp.net項目?使用Nant構建和部署asp.net,vb.net,框架1.1

我試着用這個build文件:

<?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> 

我運行這個批處理文件:

@echo off bin\nant -t:net-1.1 -buildfile:.MyWebProjPath pause 
+0

**我試圖與這個構建文件:**''<?XML版本= 「1.0」> <項目名稱= 「MyWebProj」 默認爲 「打造」 BASEDIR =」 「> \t ... \t <屬性名= 「調試」 值= 「真」 改寫= 「假」/> \t <屬性名= 「基名」 值= 「MyWebProj」/> \t <目標名稱= 「構建」> \t \t \t \t \t \t <包括名稱=」 *的.vb「/> \t \t \t ''。 **我運行這個bat文件:**''@echo off bin \ nant -t:net-1.1 -buildfile:.MyWebProjPath pause'' – gardenunez

+1

@gardenunez歡迎來到SO。您應該編輯您的問題以便將來包含後續信息,這樣人們可以更輕鬆地找到相關信息,特別是那些值得構建的數據(如XML)。我已經爲你添加了這個。希望能幫助到你。 – Scott

+0

@Scott感謝您的幫助和建議。 – gardenunez

回答

0

首先,感謝你所有的答案和建議。 這就是我終於解決了疑難問題,用這個作爲構建文件:

<?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> 

我運行這個批處理文件(就是設置-t重要的是:網1.1來指定。 .NET Framework版本):

bin\nant -t:net-1.1 -buildfile:.MyWebProjPath