简体   繁体   English

如何从Visual Studio发布中排除bin文件夹?

[英]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.

相关问题 Visual Studio转到bin和obj文件夹中的所有打开的文件,即使我在Visual Studio中也将它们排除在外 - Visual Studio Go to All open files from bin and obj folder even I exclude them in Visual Studio 我在哪里可以找到 Visual Studio 2019 中的 bin/debug 文件夹 - Where can I find the bin/debug folder in visual studio 2019 Visual Studio 将.dll 复制到发布时的 Bin 文件夹 - Visual Studio copies .dll's to Bin folder on Publish 如何从 Visual Studio 项目中排除文件/文件夹? - How to exclude file/folder from visual studio project? 如何在 Intranet 上发布源代码 (Visual Studio)? - How can I publish source code (Visual Studio) on a intranet? 如何从 Visual Studio 将可执行文件发布到我的 Azure Function? - How can I publish an exectuable file to my Azure Function from Visual Studio? Visual Studio 2022 发布菜单中没有 ftp 菜单。 如何通过 ftp 发布? - There is no ftp menu in Visual Studio 2022 publish menu. How can I publish via ftp? 如何在bin / Release for Visual Studio Project中创建文件夹? - How to create a folder in bin/Release for Visual Studio Project? 如何发布 x86 文件夹 Visual Studio 2008? - How to publish x86 folder Visual Studio 2008? 在Visual Studio中,如何从项目Resources文件夹中加载.png图像? - In Visual Studio how can I load a .png image from the project Resources folder?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM