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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:25:55+00:00 2026-05-10T19:25:55+00:00

We are looking to provide two custom Platform switches (the platform dropdown in the

  • 0

We are looking to provide two custom Platform switches (the platform dropdown in the configuration manager) for our projects in Visual Studio.

For example one for ‘Desktop’ and one for ‘Web’. The target build tasks then compile the code in a custom way based on the platform switch. We don’t want to add to the Debug Release switch because we would need those for each Desktop and Web platforms.

We found one way to attempt this, is to modify the .csproj file to add something like this

<Platform Condition=' '$(Platform)' == '' '>Desktop</Platform> 

and add propertygroups like,

    <PropertyGroup Condition=' '$(Platform)' == 'Web' '>         <DefineConstants>/define Web</DefineConstants>         <PlatformTarget>Web</PlatformTarget>       </PropertyGroup>       <PropertyGroup Condition=' '$(Platform)' == 'Desktop' '>         <DefineConstants>/define Desktop</DefineConstants>         <PlatformTarget>Desktop</PlatformTarget>       </PropertyGroup> 

But still this doesn’t work, and compiler throws an error

Invalid option ‘Desktop’ for /platform; must be anycpu, x86, Itanium or x64

So does it have to be one of those options and can’t we add our custom platforms?

Has anyone been able to do this? any pointers would be helpful.

Update: Using DebugDesktop and ReleaseDesktop will make it more complicated for users. Because ‘desktop’ and ‘web’ are actually platforms and also there is ability to add new platforms in the dropdown (i.e. ), I believe ‘platform’ switch should be used for the exact same purpose.

  • 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. 2026-05-10T19:25:56+00:00Added an answer on May 10, 2026 at 7:25 pm

    You should be able to use the Configuration Manager dialog to create new platforms.

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

Sidebar

Ask A Question

Stats

  • Questions 112k
  • Answers 112k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer http://learnwpf.com/post/2006/06/04/How-do-I-Include-Vector-Based-Image-Resources-in-my-WPF-Application.aspx explains how to do it. <ContentControl Template="{StaticResource Credit-Card}" /> May 11, 2026 at 9:53 pm
  • Editorial Team
    Editorial Team added an answer There is no way to break dependencies without making some… May 11, 2026 at 9:53 pm
  • Editorial Team
    Editorial Team added an answer For such two-part matches, use .* between the two parts.… May 11, 2026 at 9:53 pm

Related Questions

Tackling a strange scenario here. We use a proprietary workstation management application which uses
We are currently designing a business application that has two primary requirements for it's
We are changing from vs2003 to vs2005 and use vb as our primary language,
After the last project I've done using WebForms, I've decided to pass on using

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.