The best way to get a path to machine.config of a different .NET version
问题 Whats the best way to get a path to .net 2.0 machine.config file, if the application is running on .net 4.0? One way would be to do string manipulation and file system access to replace v4.0* with v2.0* in new ConfigurationFileMap().MachineConfigFilename; and then pass it to ConfigurationManager.OpenMappedMachineConfiguration(new ConfigurationFileMap(<HERE>)) . I will resort to this solution if nothing better is available. 回答1: Since I needed the path to machine.config for ASP.NET versions, I