0

I want to get the path of my app.config file, but it can't fetch it. Here is the method I've been trying:

Public Shared Function GetConfiguration(Optional ByVal fileName As String = "")
Dim map As System.Configuration.ExeConfigurationFileMap = New ExeConfigurationFileMap()
    'read file from given path
    Dim objApplicationIdentity As New ApplicationIdentity("")

    If Not String.IsNullOrEmpty(fileName) Then
        map.ExeConfigFilename = "~" & fileName ' the root web.config  
    Else
        map.ExeConfigFilename = "..\\app.config" ' the root web.config  
    End If
    ''read cogfiguration settings
    strConfig = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None)


End Function

How can I obtain the path?

das-g
  • 9,718
  • 4
  • 38
  • 80

0 Answers0