You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create the .ini file (relative path from executing directory or absolute path)
Write settings with default values
Optionally, write settings with no default value like "MySetting=". (Assuming this is valid for INI.)
When I run Build, I get...
No .ini file.
.ini file is only created if I set a value in code. Only the setting I set is inserted into the file.
IServerConfig.vb
Public Interface IServerConfig
<[Option](DefaultValue:="127.0.0.1")>
Property host As String
End Interface
Server.vb
Public Sub New()
serverConfig = New ConfigurationBuilder(Of IServerConfig)().UseIniFile(GetConfigName()).Build()
End Sub
My ugly workaround
Private Sub InitializeConfigNetFile(ByVal ConfigPath As String)
For Each prop In GetType(IServerConfig).GetProperties()
prop.SetValue(serverConfig, prop.GetValue(serverConfig))
Next
End Sub
The text was updated successfully, but these errors were encountered:
Couldn't find anywhere else to post this.
When I run Build, I expect...
When I run Build, I get...
IServerConfig.vb
Server.vb
My ugly workaround
The text was updated successfully, but these errors were encountered: