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

  • SEARCH
  • Home
  • 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 9026953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:38:39+00:00 2026-06-16T06:38:39+00:00

We have some custom MS Build scripts that generates code and configuration files for

  • 0

We have some custom MS Build scripts that generates code and configuration files for web application projects when they build. Currently we call these build scripts by overriding the “BeforeBuild” and “AfterBuild” targets in the .csproj file of the web project. However, in another solution I have a web site project which is opened directly from the local IIS and has no .csproj file. How can I customize the build of this type of project?

If it is not possible to customize the MS Build process of the web site, it would be good enough to invoke something like a .bat file which that would run my custom MS Build script. We are currently using a .bat file but the developers have to manually run it but they sometimes forget this. I can’t see a simple way to kick it off automatically when clicking build.

I would like something that runs as part of the solution build, both in Visual Studio and Team Build.

  • 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-06-16T06:38:40+00:00Added an answer on June 16, 2026 at 6:38 am

    I have now achieved what I need by adding a separate MS Build file in my solution and ensuring it builds before the web site by using the project dependencies in Visual Studio.

    The actual build file is quite minimal and is called “Configure.csproj” and sits in the root of the web site:

    <?xml version="1.0" encoding="utf-8"?>
    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="Build">
      <Import Project="CodeGeneration.targets" />
      <Target Name="Build">
        <CallTarget Targets="GenerateCode" />
      </Target>
      <Target Name="Rebuild">
        <CallTarget Targets="GenerateCode" />
      </Target>
      <Target Name="Clean">
      </Target>
    </Project>
    

    Right-click the solution and choose “Add existing project” and select this file.

    It seems odd to have this named *.csproj when there is no C# to build, but this file extension is one recognised by Visual Studio when clicking “Add existing project”.

    Then to make sure this is built before the web site, right-click the solution and choose “Project dependencies”. Select the web site project from the “Projects” drop-down list and then check the box next to “Configure”.

    It is of course possible to run a custom build after the web site by adding another project and adding a dependency on the web site.

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

Sidebar

Related Questions

I have some existing custom Excel workbooks/applications with code-behind C#, which work fine. They
I have to build a site that receives some custom report from my users
For an integration test setup, we have written some custom scripts and code to
I have some custom logic that needs to be executed every single time a
I have authored some custom classes that I would like to create using XAML:
I mantain a custom PHP application (build for me) that is hosted in a
Hy Guys... i have some lightbox script where i can build custom buttons. I've
i have wordpress blog in my custom built website, i am displaying some posts
I have built a custom component using some containers and a TileList. Now when
I have some custom type: [RdfSerializable] public class Item { [RdfProperty(true)] public string Name

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.