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 4380754
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:34:12+00:00 2026-05-21T12:34:12+00:00

I need to let all projects in solution contain some additional build actions, e.g.

  • 0

I need to let all projects in solution contain some additional build actions, e.g. StyleCop validation, autogenaration of AssemblyInfo’s, etc.

My idea is to make some kind of solution-wide prebuild event that will check all project files for containing nodes that match specific xPath. It’s not a hard part, it can be solved either with custom build task, or with some third-party Xml handling task. I didn’t investigate it deeply yet, but it definitely won’t make a problem worth mentioning here.

The questions are how to
1) extend solution file with some custom tasks? It shouldn’t be necessary integral part of solution. It is desired, but can be omitted while building from VS, it will be enough to have some specific command line that executes it.
2) if its not possible, there is option described in “Solution-wide pre-build event?“. It’s hacky, but if there is no other options, I’ll use it. But how to get list of project files from solution file? Please, take into account that folder that contains solution may contain extra project files that shouldn’t be check, so just enumerate all ***.*proj is not an option.

P.S. Any other options for entire problem are welcome too 🙂

  • 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-21T12:34:12+00:00Added an answer on May 21, 2026 at 12:34 pm

    You can create any custom tasks with any conditions using built in MSBuild feature to extend functionality: CustomAfterMicrosoftCommonTargets, CustomBeforeMicrosoftCommonTargets.

    See my example. You can add custom tasks in your .targets file for every step in build process. You can add conditions to turn on/off those actions and so on. It doesn’t rely on sln file, but you can have tasks that will be VS-specific with condition ‘$(BuildingInsideVisualStudio)’==’true’. You can call them from command line – you need to specify the name of target with key /t:MyCustomTarget.

    Sideeffects: if your custom target willn’t have any specific conditions – it will be called in every similar project.

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

Sidebar

Related Questions

I need a basic pdf generator that'll let me toss some images and text
Let's say that for some reason you need to write a macro: MACRO(X,Y) .
My application has a need to let the user choose a date from a
Let me try to explain what I need. I have a server that is
Let's say I have an integer that I need to convert to a string
Let's say we have 0.33 , we need to output 1/3 . If we
A friend was in need of an algorithm that would let him loop through
I need to find basic WYSIWYG HTML editor component for C++Builder 5 to let
I need to write test cases for my application. I've chosen NUnit. Please let
First, let me explain what I am doing. I need to take an order,

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.