Solved

ASP.NET Exclude directory from "Build", but include in "Publish"

Posted on 2010-08-17
9
827 Views
Last Modified: 2013-11-27
I have a MVC application with one directory with aspx pages and I am trying to accomplish the following:

- Exclude that directory during "Build" (compile)

- Include the directory after "Publishing"

(or use a script/macro to copy it manually or something like that)

Any ideas on how to do that?
0
Comment
Question by:conrad2010
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 16

Expert Comment

by:13598
ID: 33459445
You could try on the solution explorer tree right-clicking on the folder and select Exclude from project while you are debugging.
Before publishing right-click again and select Include in Project.
0
 

Author Comment

by:conrad2010
ID: 33459521
@13598:

when I do that, that directory will compile... I want to prevent it from compiling but send it to the production server...
0
 
LVL 16

Expert Comment

by:13598
ID: 33466389
Exclude from Project compiles it? Did you clear it (delete the directory) before you changed it to exclude ?
0
More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

 
LVL 16

Expert Comment

by:13598
ID: 33466644
Also what is the reason to exclude it during debug?
You can specify a different folder to compile it to during debug than release so you wouldn't have to worry about it after you change your configuration to release and rebuild it.
Under your Project Properties/Compile tab/Build Output Path you can enter something like bin\debug for your debug configuration and leave it as just \bin for your release configuration.
0
 

Author Comment

by:conrad2010
ID: 33466711
@13598:

the main project is MVC, but there is a "promo" directory with html, asp and aspx where the aspx cannot be compiled with the MVC (it breaks)...

so I'm trying to "exclude" the folder when compiling, but still include it when publishing to the production server

I've looked into post-build events but I'm not clear on how to include the folder after compiling
0
 

Author Comment

by:conrad2010
ID: 33466715
I know I could simply FTP it, but I want to try a "one button push" solution
0
 
LVL 16

Accepted Solution

by:
13598 earned 500 total points
ID: 33466837
Take a look at this:
http://stackoverflow.com/questions/699610/adding-to-built-in-excludefrombuild-itemgroup-with-web-deployment-project
And this:

MSBuild has a special syntax for recursing "**\", here is an example:
<ItemGroup>
<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.resx"/>
</ItemGroup>
 
0
 
LVL 16

Assisted Solution

by:13598
13598 earned 500 total points
ID: 33466860
0
 

Author Closing Comment

by:conrad2010
ID: 33467002
Thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question