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

Related Questions

I have a .net winforms app which has a few animation effects, fade ins
I have a .net (3.5) WinForms application and want to display some html on
I have a .net 3.5 WinForms application that runs fine on my machine, but
I have a .NET 3.5 WinForms project that uses several 3rd party controls and
We have an MSI installer for a .Net WinForms app for Windows XP that
We have a .NET 2.0 winforms app that connects to a SQL Server 2005
I have this app written in VB.Net with winforms that shows some stats and
I have a WinForms application that was written in C# .NET 3.5. This application
I have a RichTextBox in .NET WinForms. I have been hooking up hot keys
I have a .NET 2.0 WinForms application with a ToolStrip on my main form.

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.