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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:32:15+00:00 2026-05-11T05:32:15+00:00

I have a c# .net winforms solution and I want to create two different

  • 0

I have a c# .net winforms solution and I want to create two different builds: one that supports IE6 and one that supports IE7. A few of the files in one of my projects are different for the IE6 build versus the IE7 build, so I want to include the IE6 files when I build for IE6 and the IE7 files when I build for IE7. What’s the best way of structuring my solution for this situation?

Due to other constraints I do not want to create a separate assembly that contains the shared items; I want the project to compile to a single assembly ‘foo.dll’ regardless of which build I’m making.

I thought I could just create two separate projects that compile to ‘foo.dll’, then create two Release Configurations and only include the relevant project in the relevant configuration. However I’d need to include the files that are the same for IE6 and IE7 in both projects, and I can’t see how to use a single copy of a file in two projects (when I Add Existing Item it creates a copy in the project directory). I’m using SVN for source control so could perhaps use that to do the ‘sharing’ between folders, but doubt that’s the best way..

NB: Different builds are needed due to API differences in IE, details of which aren’t relevant to the question – just believe me that there are two builds required.

  • 1 1 Answer
  • 1 View
  • 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-11T05:32:15+00:00Added an answer on May 11, 2026 at 5:32 am

    In MSBuild, you can specify conditions to item groups. You can then bind those conditions to the target device.

    Example:

    <!-- Declare the condition property at the beggining of the build file --> <PropertyGroup Condition='$(Platform) == 'IE7''>   <UseNewLibrary>true</UseNewLibrary> </PropertyGroup>  <PropertyGroup Condition='$(Platform) == 'IE6''>   <UseNewLibrary>false</UseNewLibrary> </PropertyGroup>   <!-- Then those the property to select the right file --> <ItemGroup Condition='$(UseNewLibrary)==true'>   <Compile Include='Class1.cs'/>   <Compile Include='Class2.cs'/>   <Compile Include='Class3.cs'/>   <Compile Include='Class4.cs'/> </ItemGroup>  <ItemGroup Condition='$(UseNewLibrary)==false'>    <Compile Include='Class1Old.cs'/>    <Compile Include='Class2Old.cs'/>    <Compile Include='Class3Old.cs'/>    <Compile Include='Class4Old.cs'/> </ItemGroup>  <!-- And now references --> <ItemGroup Condition='$(UseNewLibrary)==true'>   <Reference Include='MyAssembly, Version=1.1.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' /> </ItemGroup>  <ItemGroup Condition='$(UseNewLibrary)==false'>   <Reference Include='MyAssembly, Version=1.0.6.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' /> </ItemGroup> 

    Note that all files will appear in the IDE, but at compile time everything should align correctly.

    Then, all you need to do is create your platforms (IE6 and IE7) in the configuration management.

    You can also directly use the platform property instead of creating an intermediate property.

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

Sidebar

Ask A Question

Stats

  • Questions 84k
  • Answers 84k
  • 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 I am making the assumption that you have the name… May 11, 2026 at 5:01 pm
  • Editorial Team
    Editorial Team added an answer There's a page in the SQLite site that lists many… May 11, 2026 at 5:01 pm
  • Editorial Team
    Editorial Team added an answer EDIT2: Right solution from the comments: shahkalpesh: If it executes… May 11, 2026 at 5:01 pm

Related Questions

I'm planning on writing a medium-size WinForms application that I'll write in C#, .NET
Does anyone know, or have a link to an article or a step by
I am in the process of converting a ASP.Net Web App to a C#
I have a WinForms .NET app that, according to the Vista Task Manager with

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.