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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:18:33+00:00 2026-05-18T12:18:33+00:00

I changed the target .NET framework of my WPF app from 3.5 to 4.0.

  • 0

I changed the target .NET framework of my WPF app from 3.5 to 4.0.

After making this change, I noticed that an app.config file was generated by VS2010 and placed in the main project folder. Its build action is set to “none — do not copy”.

This app.config file contains the following XML:

<?xml version="1.0"?>
<configuration>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
</configuration>

The .csproj file for my project contains:

<Project
    ToolsVersion="4.0" DefaultTargets="Build"
    xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

Questions:

  1. What is the difference in meaning between <supportedRuntime version="4.0" in app.config and <Project ToolsVersion="4.0" in .csproj? Does one override the other or do they actually mean different things?
  2. Does the app.config file do anything if not copied to the output directory?
  3. Can I delete the app.config file without breaking anything?

Edit

One more question:

If I create a WPF 4.0 app from scratch, why is no app.config file created by default? (And doesn’t this imply that the file is unnecessary?)

  • 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-18T12:18:33+00:00Added an answer on May 18, 2026 at 12:18 pm

    This Microsoft blog article explains it pretty well:

    http://blogs.msdn.com/b/jgoldb/archive/2010/04/12/what-s-new-in-net-framework-4-client-profile-rtm.aspx

    What’s the deal with app.config file?

    If you change the project to target the Full Framework, VS will add a configuration file (app.config) that declares the application as a "full" application.

    alt text

    This enables the CLR loader to block any NET4 apps that target full on machines that only have the Client Profile. In this case, the CLR prompts the user to install NET4 full.

    E.g. you may see this dialog:

    alt text

    Note that in NET4 Beta1 and NET3.5 SP1 Client Profile, if the app.config was missing the CLR, the assumption was that you targeted the Full Framework. This is now reversed.
    In other words, if your NET4 app is missing app.config, by default the CLR assumes that your app is targeting NET4 Client Profile! So, your app may crash at random when it needs to load the assemblies that aren’t in the Client Profile.

    Specific Answers:

    1. As SLaks said, the .csproj settings tells the compiler what framework version to use, while the app.config file is used by the runtime (CLR) to determine which (if any) framework version the user needs to download.

    2. app.config will be copied to the output even if the build action is "none — do not copy". app.config is a special file that will automatically be renamed to "[name_of_app].exe.config" then copied to the output directory.

    3. For WPF 4.0 apps, app.config can be omitted if the app targets the .NET 4.0 Client Profile. If it targets the full .NET 4.0 framework (which includes things like asp.net), the file must be kept.

    4. The reason this file is not created by default is that WPF 4.0 apps target .NET Framework 4.0 Client Profile by default. Since the runtime will assume that all .NET 4.0 apps need only the Client Profile installed, everything will be fine.

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

Sidebar

Related Questions

I upgrade a wpf desktop application from .net 3.5 to .net 4.0.(Changed the target
I changed the target framework of a WPF application to use .NET 4 and
A few weeks ago I changed the target .NET framework for my application to
Is it possible to change the target framework to .net 4.0 in an application
I need to change the .NET Framework Version of my Sharepoint Project from 3.5
I changed target framework from 3.5 to 4.0, no other changes. A simple ping
Is it possible to change the target market for existing IOS app while doing
I would like to change the target of symbolic link from within a bash
Possible Duplicate: Change the Target Framework for all my projects in a Visual Studio
We have a solution that targets .NET Framework 3.5 (that's because a COM interop

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.