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 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

Related Questions

I'm looking for the best way to provide authorization, authentication, and auditing to web
I'm looking into using Lucene and/or Solr to provide search in an RDBMS-powered web
Looking for an example that: Launches an EXE Waits for the EXE to finish.
I am looking for the state.sql file provided by the .NET framework to run
I am looking for a Silverlight text editor control that provides XML syntax highlighting
I'm looking at moving my application from using active directory membership provider to using
Looking for feedback on : http://code.google.com/p/google-perftools/wiki/GooglePerformanceTools
Looking for C# class which wraps calls to do the following: read and write
Looking at what's running and nothing jumps out. Thanks!

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.