Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS Visual Studio: How to exclude certain Project Folders from publishing?

I have certain folders which I want to keep in the project but not to include it in publishing.

Is that possible?

like image 415
meetpd Avatar asked May 24 '11 01:05

meetpd


People also ask

How do I exclude a project in Visual Studio?

On the menu bar, choose Build > Configuration Manager. In the Project contexts table, locate the project you want to exclude from the build. In the Build column for the project, clear the check box. Choose the Close button, and then rebuild the solution.

How do I get excluded files in Visual Studio?

In Visual Studio, right-click on the file to be excluded from build, choose Properties, Configuration Properties -> General -> Excluded From Build -> Yes -> OK. In Eclipse, right-click on the file to be excluded from build, choose Properties, C/C++ Build -> Excluded from build -> OK.

How do I show excluded folders in Visual Studio?

Open the project in Visual Studio Team Edition for Database Professionals. Open the Project menu and click Show All Files. This will display excluded files in Solution Explorer. In Solution Explorer, click the folder that you had previously excluded.

How do I exclude files from a folder?

(2) Go to the "Settings" tab and Click "Exclude files and locations". Then, click "Browse". (3) Here, at this step, you can use either a file or a folder. Select a file or a folder and click OK.


1 Answers

If it is a web-site project, you may exclude certain folders and/or files as follows (see elements ExcludeFoldersFromDeployment and ExcludeFilesFromDeployment):

<?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>FileSystem</WebPublishMethod>         <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>         <LastUsedPlatform>Any CPU</LastUsedPlatform>         <SiteUrlToLaunchAfterPublish />         <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>         <ExcludeApp_Data>True</ExcludeApp_Data>         <publishUrl>D:\YAZILIM\Adopen.2015\PreCompiledWeb</publishUrl>         <DeleteExistingFiles>True</DeleteExistingFiles>         <PrecompileBeforePublish>True</PrecompileBeforePublish>         <EnableUpdateable>True</EnableUpdateable>         <DebugSymbols>False</DebugSymbols>         <WDPMergeOption>MergeAllOutputsToASingleAssembly</WDPMergeOption>         <UseMerge>True</UseMerge>         <SingleAssemblyName>AdoIntranet</SingleAssemblyName>         <ExcludeFoldersFromDeployment>customobjects;uploads</ExcludeFoldersFromDeployment>          <ExcludeFilesFromDeployment>app.config</ExcludeFilesFromDeployment>     </PropertyGroup> </Project> 
like image 196
HGMamaci Avatar answered Sep 25 '22 17:09

HGMamaci