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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:23:06+00:00 2026-05-27T08:23:06+00:00

I have a solution with multiple projects. I am trying to use MSBUILD to

  • 0

I have a solution with multiple projects. I am trying to use MSBUILD to automate the deployment. I have following configuration values for building
1. Debug
2. Release
3. Dev
For Some projects, I am using Release mode for DEV configuration. But while using DEV as configuration in MSBUILD command, it is throwing exception saying DEV configuration was not found.

Is there any way we can tell MSBUILD to use Release mode if DEV is not available for a project when DEV is used as configuration in MSBUILD?

Thanks
Ashwani

  • 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-27T08:23:07+00:00Added an answer on May 27, 2026 at 8:23 am

    In your (presumably C#) project file, there is typically a line that looks like this:

    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    

    For the projects that don’t have a “Dev” configuration, you can get the behavior you want by adding another line, right before that one…

    <Configuration Condition=" '$(Configuration)' == 'Dev' ">Release</Configuration>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    

    This way, when you build with “Dev” specified, these projects will build their Release configuration instead, which mimics the behavior of the solution’s configuration manager (which I tend to think of as an abomination of a feature) directly in the project file itself, which is the right place to do it.

    Another approach is to use the AdditionalProperties metadata on the item array you would be passing to the MSBuild task to get your projects built. You can specify–for the projects of interest–the following…

    <SolutionItem Include="./PathTo/SomeProject.csproj">
       <AdditionalProperties Condition="'$(Configuration)' == 'Dev'"
          >Configuration=Release</AdditionalProperties>
    </SolutionItem>
    

    (Excerpted from the book “MSBuild Trickery” trick #80)

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

Sidebar

Related Questions

I have a solution with multiple projects in it. When I want to debug
I have a solution with multiple projects and we need to do some serious
my solution has multiple projects and in one of them I have the code
I have a solution which has multiple output projects (a website, and admin tool,
If I have an existing solution containing multiple c# projects, are there any static
I have a solution in Visual Studio 2008 which has multiple projects. One of
I have a visual studio 2008 solution with multiple c# library projects, a Web
I have a solution made up of multiple projects which have various dependencies on
I have a solution with multiple projects. I have a main project, which acts
I have a solution with multiple projects. In each project I've added a .config

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.