Solved

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

Posted on 2010-08-17
9
820 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
  • 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now