【发布时间】:2018-01-25 22:40:48
【问题描述】:
我想排除 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>
【问题讨论】:
标签: c# asp.net visual-studio visual-studio-2015