Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wherefore art thou app.config?

I've noticed in Visual C# 2010, whenever you change the target framework version away from the default 4.0 client profile (and even if you change it back afterwards), the IDE creates a. config file that it clearly thinks ought to be shipped with the program. The .config file basically just says what the supported/target framework version is.

Now, as far as I've been able to tell from a Google search, if that file is not present, the fallback is to try to run the program against the framework version it was built against.

Since that is presumably the same as the version the .config file says, doesn't that mean the .config file has no effect and can be omitted? Or am I missing something?

like image 735
rwallace Avatar asked Jun 28 '10 12:06

rwallace


1 Answers

If the version you compiled with is the same as the version you want to run in then yes it is not required to keep this config file. But say you compiled for .Net 2.0 and want to force your assembly to run in the .Net 4.0 runtime. You could use this setting to affect your application. You could also use this to force your application to use different versions of the runtime if they cause known issues with your application. (I haven't seen any problems like this yet so I can only speculate.)

  • How to: Configure Runtime Version
  • supportedRuntime Element
like image 96
Matthew Whited Avatar answered Oct 01 '22 03:10

Matthew Whited