2017-08-17 198 views
0

我想排除bin文件夾被複制到發佈目錄。如何從Visual Studio發佈中排除bin文件夾?

使用Visual Studio 2015年,Asp.Net Web應用程序項目

下面是我的.pubxml文件。請注意,「bin」列在ExcludeFoldersFromDeployment元素中。列出的所有其他文件夾按預期排除,但此bin文件夾仍被複制!

bin目錄不同我想象它不是項目的一部分,而是構建輸出的一部分。我的編譯輸出路徑指向與我發佈並正常工作不同的目錄。爲什麼bin仍然被複制到發佈輸出目錄?可以排除嗎?

<?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> 
    <ExcludeFilesFromDeployment>Web.config;Default.aspx;packages.config</ExcludeFilesFromDeployment> 
    <ExcludeFoldersFromDeployment>bin;js;TestingUtils;TestPages;UI</ExcludeFoldersFromDeployment> 
    <WebPublishMethod>FileSystem</WebPublishMethod> 
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> 
    <LastUsedPlatform>Any CPU</LastUsedPlatform> 
    <SiteUrlToLaunchAfterPublish /> 
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> 
    <ExcludeApp_Data>False</ExcludeApp_Data> 
    <publishUrl>C:\website</publishUrl> 
    <DeleteExistingFiles>True</DeleteExistingFiles> 
    </PropertyGroup> 
</Project> 

回答

0

您可以使用下面的標籤在你的XML發佈配置:

<ExcludeFoldersFromDeployment>bin< 
+0

編輯的問題作出明確我已經這樣做了,它不起作用 – mje777

0

我只是在我的發佈配置插入<ExcludeFoldersFromDeployment>bin</ExcludeFoldersFromDeployment>和它沒有包括bin文件夾

+0

什麼版本的Visual Studio?我使用的是VS 2015,並且還使用了諸如' bin; folder1; folder2'的文件夾列表。這對我不起作用 – mje777

+0

我也在使用VS 2015 – vily

相關問題