2011-02-18 65 views
0

我试图创建一个msbuild脚本,它将编译并将测试应用程序放置到桌面上的文件夹中。我不希望这个应用程序发布到IIS。我跟踪了几个blgos,并通过hashimi的书看,但我仍然无法弄清楚这一点。以下是我的脚本。非常感谢你!Msbuild编译网站时未将网站置于IIS中

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <Target Name="Clean"> 
    <ItemGroup> 
     <BinFiles Include="bin\*.*" /> 

    </ItemGroup> 
    <Delete Files="@(BinFiles)" /> 
    </Target> 
    <Target Name="Compile" DependsOnTargets="Clean"> 
    <MSBuild Projects="test.vbproj"/> 
    </Target> 
    <Target Name="Publish" DependsOnTargets="Compile"> 
    <RemoveDir Directories="$(OutputFolder)" 
    ContinueOnError="true"/> 
    <MSBuild Projects="test.vbproj" 
      targets="ResolveReferences;_CopyWebApplication" 
      Properties="WebProjectOutputdir=$(OutputFolder; OutDir=$WebProjectOutputDir)\"/> 
      </Target> 
    </Target> 
</Project> 

回答

0

你的脚本有点尴尬(你重新定义了干净的目标和基本的干净目标一样)。

我很确定你的问题来自CopyWebApplication,它根据在你的项目文件中设置的属性并通过命令行进行大量的工作。

你可以试试下面的脚本:

<Project DefaultTargets="Compile" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <Target Name="Compile"> 
    <MSBuild 
     Projects="test.vbproj" 
     Targets="Clean;Build" 
     Properties="OutputPath=C:\tmp"/>  
    </Target> 
</Project> 

如果您的测试项目是一个网站,那么构建目标应在OutputPath/OUTDIR财产

+0

该工程中指定的文件夹中创建它!非常感谢 – gh9 2011-02-21 19:45:13