[英]How can I exclude the bin folder from Visual Studio publish?
I want to exclude the bin folder from being copied to the publish directory. 我想将bin文件夹排除在复制到publish目录之外。
Using Visual Studio 2015, Asp.Net Web Application Project 使用Visual Studio 2015,Asp.Net Web应用程序项目
Below is my .pubxml file. 以下是我的.pubxml文件。 Notice that "bin" is listed inside the ExcludeFoldersFromDeployment element. 注意,“ bin”在ExcludeFoldersFromDeployment元素内列出。 All of the other folders listed there are excluded as expected, but this bin folder is still copied! 此处列出的所有其他文件夹均被排除在外,但是此bin文件夹仍被复制!
The bin directory is different I imagine as it is not part of the project, but part of the build output. 我想象中的bin目录是不同的,因为它不是项目的一部分,而是构建输出的一部分。 My build output path is pointing to a different directory than my publish and working correctly. 我的生成输出路径指向与发布不同的目录,并且可以正常工作。 why is the bin still being copied to the publish output directory?? 为什么将bin仍复制到publish输出目录中? can it be excluded?? 可以排除在外吗?
<?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>
您可以在xml发布配置文件中使用以下标记:
<ExcludeFoldersFromDeployment>bin<
我只是在发布配置文件中插入了<ExcludeFoldersFromDeployment>bin</ExcludeFoldersFromDeployment>
,它没有包含bin文件夹
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.