2014-10-02 65 views
1

有一個VS2013解決方案與多個Web項目。其中只有兩個應該在TFS 2013服務器上發佈。這兩個項目都有一個有效的build.pubxml自己的發佈配置文件。其他Web項目沒有發佈配置文件,因爲我不想發佈它們。如何忽略在TFS 2013上發佈的一個或多個Web項目?

TFS構建是中斷與以下異常: C:\ Program Files文件(x86)的\的MSBuild \微軟\ VisualStudio的\ V12.0 \網絡\ Microsoft.Web.Publishing.targets(4346):該值PublishProfile設置爲'build.pubxml',預計會在'C:\ Builds \ 1 ... \ PublishProfiles \ build.pubxml'中找到該文件,但找不到該文件。

我的問題是我如何忽略項目發佈?

回答

1

編輯:更新爲我原來的答案沒有工作,並導致構建 炸燬。現在建議創建一個zip包,但不要 實際部署web應用程序。同樣的想法不同的實現

添加虛擬build.pubxml文件到每個不需要的項目,並將它們設置爲不發佈,而是產生一個包,將工作,而不會自動發佈該網站。

<?xml version="1.0" encoding="utf-8"?> 
<!-- 
This file is used by the publish/package process of your Web project. You can customize the behavior of this process 
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121. 
--> 
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <PropertyGroup> 
    <WebPublishMethod>Package</WebPublishMethod> 
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> 
    <LastUsedPlatform>Any CPU</LastUsedPlatform> 
    <SiteUrlToLaunchAfterPublish /> 
    <LaunchSiteAfterPublish>False</LaunchSiteAfterPublish> 
    <ExcludeApp_Data>True</ExcludeApp_Data> 
    <DesktopBuildPackageLocation>Webapplication2.zip</DesktopBuildPackageLocation> 
    <PackageAsSingleFile>true</PackageAsSingleFile> 
    <DeployIisAppPath>webapplication2</DeployIisAppPath> 
    <PublishDatabaseSettings> 
     <Objects xmlns="" /> 
    </PublishDatabaseSettings> 
    </PropertyGroup> 
</Project> 

這應該允許構建找到發佈配置文件,爲不需要的web應用創建一個zip文件,但實際上並未部署它們。

相關問題