Why are the .NET app.config download rules different for win2k3?

... and are there other warnings for other platforms?

I am creating app.config for a win forms project like Application.exe.

By default, I expect that at runtime my application will look for the Application.exe.config file.

But there seem to be exceptions to this, for example, in a Windows Server 2003 environment, an application will look for Application.config .

The full path to the configuration search file is different in Windows Server 2003, why is this?

Where is the definition for these cosmic app.config loading rules?

+4
source share
2 answers

I have no data, but I believe that the service pack or dotted version of the .NET Framework allowed ExeName.config be an option, and now it is still supported for backward compatibility, but the later service packages returned to default ExeName.exe.config for all systems.

+2
source

From MSDN :

The name and location of the application configuration file depends on the application host, which can be one of the following:

The executable application.

The configuration file for the application hosted by the executable host is in the same directory as the application. The configuration file name is the name of the application with the extension .config. For example, the myApp.exe application may be associated with the myApp.exe.config configuration file .

And also

For client executables, the application configuration file is located in the same directory as the application executable and has the same base name as the executable with the extension .config. For example, the configuration file for C: \ Program Files \ Myapp \ Myapp.exe is C: \ Program Files \ Myapp \ Myapp.exe.config.

0
source

All Articles