Ik maak sinds een lange tijd al gebruik van de XML comments.
Nu wil ik alleen een stuk XML in me <b><example></b> gedeelte een voorbeelde zetten van de app.settings file. Maar dit is ook XML, hoe zet ik dit er tussen? Bij het compilen komt vs met devolgende fout:
Nu wil ik alleen een stuk XML in me <b><example></b> gedeelte een voorbeelde zetten van de app.settings file. Maar dit is ook XML, hoe zet ik dit er tussen? Bij het compilen komt vs met devolgende fout:
D:\QuSoft\Software\ErrorReport\ErrorReport.cs(249): XML comment on 'Qusoft.ErrorReport.LoadSettings()' has badly formed XML -- 'Invalid xml declaration.
'
C#:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| /// <summary> /// Load the SMTP setting from the appliction settings file. /// </summary> /// <example> /// <?xml version="1.0" encoding="utf-8" /> /// <configuration> /// <appSettings> /// <!-- Error report settings /> /// <add key="errorreport:smtp" value="smtp.domain.com" /> /// <add key="errorreport:to" value="alias@domain.com" /> /// <add key="errorreport:port" value="25" /> /// <add key="errorreport:username" value="username" /> /// <add key="errorreport:password" value="password" /> /// </appSettings> /// </configuration> /// </example> public void LoadSettings() { this.SMTP = ConfigurationSettings.AppSettings.Get("errorreport:smtp"); this.To = ConfigurationSettings.AppSettings.Get("errorreport:to"); this.Port = int.Parse(ConfigurationSettings.AppSettings.Get("errorreport:port")); this.Username = ConfigurationSettings.AppSettings.Get("errorreport:username"); this.Password = ConfigurationSettings.AppSettings.Get("errorreport:password"); } |