Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 738859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:20:03+00:00 2026-05-14T08:20:03+00:00

In Visual Studio 2008 we run a post build event which calls NANT and

  • 0

In Visual Studio 2008 we run a post build event which calls NANT and in turn creates our config files.

e.g.

if $(SolutionDir) == . GOTO end
nant -buildfile:$(SolutionDir)default.build create..web.config

Is there a way to run this only on ReBuild?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:20:04+00:00Added an answer on May 14, 2026 at 8:20 am

    I think you can do this by specifying build targets rather than using build events. Try creating an AfterClean target to delete your generated config files, and a BeforeBuild target to create them. Make sure you set up the file dependency for the BeforeBuild target, so msbuild knows it should only run the step if the file isn’t present.

    I haven’t actually tried this, but I beleive msbuild will only run the target if the target files don’t exist. When you rebuild, the cleaning process will be invoked, and in turn your AfterClean target.

    You can read more about build targets here. The only real downside to using build targets instead of events is that they are not visible anywhere in the VS UI – you will only find them if you inspect the project file.

    There may be a more direct solution involving events – have look at the msbuild team blog here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Visual Studio (2008) is it possible to force the Post-Build Event for a
I run the Visual Studio 2008 profiler on a RelDebug build of my app.
I installed visual studio 2008 in our server and tried to run our proejct
I currently run Visual Studio 2008 SP1 connecting to Team Foundation Server. I want
I currently use visual studio 2008 for creating projects that can run on windows.
When I run my MSTest tests in Visual Studio 2008 Team System and get
Is it possible to write and run with Visual Studio 2008 some unit test
I'm currently investigating my options to run automated tests from within Visual Studio 2008
Here, we run a set of Visual Studio 2008's CA rules both locally and
I created a VB.NET Windows Forms Application in Visual Studio 2008. When I run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.