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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:17:26+00:00 2026-05-29T15:17:26+00:00

We have various versions of our base application out in the field: Version 1.0

  • 0

We have various versions of our base application out in the field:

  • Version 1.0 comes bundled with .NET Framework 3.5
  • Version 2.0 comes bundled with .NET Framework 4.0

We distribute updates via an installer which embeds a .NET executable in them. The PC that this installer runs on may have the following combinations of our base application:

  • Both Version 1.0 and Version 2.0 (.NET 3.5 / .NET 4.0)
  • Version 1.0 only (.NET 3.5 only)
  • Version 2.0 only (.NET 4.0 only)

I need to ensure that the .NET executable embedded in the installer will run reliably.

The approaches I have found suggest adding the following to the app.config file:

<startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    <supportedRuntime version="v2.0.50727"/>
</startup>

A few questions:

  1. Will this mean that it will use .NET Framework 4.0 if it is present, otherwise resorting to .NET Framework 3.5 (or any previous frameworks that use the 2.0.50727 CLR)? IOW, are these tags ordered by priority?

  2. Does the version of the .NET Framework on the build machine have any run-time effect on the application, or does the hardcoding of the versions in the app.config file always take priority?

  3. What happens if I added code which relied upon a feature specific to .NET 4.0? Would including the 2.0.50727 version in the app.config (as shown above) result in a compile-time error, or a run-time error (only if .NET 4.0 wasn’t installed)?

  • 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-29T15:17:28+00:00Added an answer on May 29, 2026 at 3:17 pm
    1. Yes, they’re ordered by priority. It’s easiest to try that with a simple console app:

      using System;
      
      class Test
      {
          static void Main()
          {
              Console.WriteLine(Environment.Version);
          }
      }
      

      Compile that with .NET 3.5, then run it with your current configuration, and it’ll show 4.0 – then switch the lines and it’ll show 2.0. See this MSDN article for more details.

    2. The version of the framework that you’ve targeted your app at is the important thing. If your config specifies that you support .NET 2, but you’ve targeted .NET 4, the application won’t start.

    3. You won’t have relied on a feature specific to .NET 4 without targeting .NET 4, in which case it won’t run on .NET 2.

    Point 3 isn’t strictly accurate, in that there are things you can do which will differ based on which version of .NET is running. For example, change the app to:

    using System;
    using System.Collections.Generic;
    
    class Test
    {
        static void Main()
        {
            object o = new List<string>();
            Console.WriteLine(o is IEnumerable<object>);
        }
    }
    

    When running with .NET 2 that will print False (because IEnumerable<T> was invariant in .NET 2) but when running with .NET 4 it will print True because of generic covariance.

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

Sidebar

Related Questions

I have a bit of a challenge. In an earlier version of our product,
We have an application that uses various system tray icons to communicate with users.
I have a JSON data file that is part of my application (version controlled,
I have VS2005 and VS2008 installed on my pc. I have .NET Framework 2.0
We are supporting a VB.Net application that gets distributed to various schools that use
I have various questions regarding Maven 3 and Nexus repository. At our nexus repository
In our stack, we use neo4j and have encountered classical performance issues : application
we have a magento store with various categories one inside another (subcategory). Our problem
I have various class which perform save and update operations of GUI elements, it
I have various time-series I'd like to correlate and present as either a csv-file

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.