Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
FilePath Property

Configuration.FilePath Property

Gets the physical path to the configuration file represented by this Configuration object.

Namespace:  System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)

public string FilePath { get; }

Property Value

Type: System.String
The physical path to the configuration file represented by this Configuration object.

If the value for this FilePath property represents a merged view and no actual file exists for the application, the path to the parent configuration file is returned.

The following code example demonstrates how to use the FilePath property.

string filePath = config.FilePath;
Console.WriteLine("File path: {0}", filePath);

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft