First thanks for chiming in!!!
Yes I am getting a blank value.
The best way to describe my app.config, enter a name to reference i.e.
"Test" and then enter a string value for "test" i.e. "Hello". I would
copy-n-paste my simple app.config here but needed to more forwards with an
alternate solution until my original question could be solved and now using
XML
This is my solution away from app.config in the DLL until someone can tell
me the correct method to read app.config from a supporting DLL
Public Class ReadConfigurati on
Private strLogFile As String
Private strSendToMailAd dress As String
Private strFromMailAddr ess As String
Private strServer As String
''' <summary>
'''
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public Property LogFile() As String
Get
Return strLogFile
End Get
Set(ByVal value As String)
strLogFile = value
End Set
End Property
Public Property SendToMailAddre ss() As String
Get
Return strSendToMailAd dress
End Get
Set(ByVal value As String)
strSendToMailAd dress = value
End Set
End Property
Public Property FromMailAddress () As String
Get
Return strFromMailAddr ess
End Get
Set(ByVal value As String)
strFromMailAddr ess = value
End Set
End Property
Public Property Server() As String
Get
Return strServer
End Get
Set(ByVal value As String)
strServer = value
End Set
End Property
Sub New()
If IO.File.Exists( "unhandledExcep tions.xml") Then
Using ConfigurationFi le As New
System.Xml.XmlT extReader("unha ndledExceptions .xml")
ConfigurationFi le.WhitespaceHa ndling =
System.Xml.Whit espaceHandling. None
Do While ConfigurationFi le.Read()
If ConfigurationFi le.NodeType =
System.Xml.XmlN odeType.Element Then
Select Case ConfigurationFi le.Name
Case "PrimaryLogFile "
LogFile = ConfigurationFi le.ReadString
Case "SendEmailTooAd dress"
SendToMailAddre ss = ConfigurationFi le.ReadString
Case "EmailFromAddre ss"
SendToMailAddre ss = ConfigurationFi le.ReadString
Case "SmtpClientServ er"
Server = ConfigurationFi le.ReadString
End Select
End If
Loop
End Using
End If
End Sub
End Class
<?xml version="1.0" encoding="UTF-8" standalone="yes " ?>
<UHE>
<PrimaryLogFile >logExceptions. txt</PrimaryLogFile>
<SendEmailTooAd dress></SendEmailTooAdd ress>
<EmailFromAddre ss></EmailFromAddres s>
<SmtpClientServ er></SmtpClientServe r>
</UHE>
"Spam Catcher" <sp**********@r ogers.comwrote in message
news:Xn******** *************** ***********@127 .0.0.1...
"Kevin S Gallagher" <ke************ ***@state.or.us wrote in
news:er******** ******@TK2MSFTN GP04.phx.gbl:
>I have been attempting to read a value from the starting executable
while in a DLL.
So far have tried the following were "Test" is a defined value in the
EXE. What is returned is a blank/empty string
System.Configu ration.Configur ationManager.Ap pSettings.Item( "Test")
Did some research on Google but only found people untried suggestions,
none that work in .NET Framework 2.
That usually works fine for me.
Are you getting a blank value? how does your App.config look like?