| 

.NET C# Java Javascript Exception

4
Wenn ich eine Einstellungsdatei für eine Assembly in Visual Studio erstelle, so kann ich in der Designer Oberfläche eine Beschreibung für jede Einstellung angeben. Kann ich diese Beschreibung mit in die Konfigurationsdatei, also die <AssemblyName>.<AssemblyEndung>.config Datei kompilieren/extrahieren lassen?
News:
14.11.2011
CodingCooky 21 2
1 Antwort
2
Soweit ich sehe geht das nicht. Auch Kommentare in der app.config werden bei jeder Änderung im Settings Designer wieder überschreiben. Siehe dazu auch der Kommentar in der MSDN: Application Settings
Configuration Comments
I looked into using the Settings class, but it seems to have a fatal flaw. One of the properties of a setting is a description, but this doesn't make it into the app.config as a comment.

Seems to me the whole purpose of a config file to be shipped with a product is so that the customer can modify the settings to control the behavior of the application. Without comments in the config file, it makes that job much tougher. Instead of using a self-documenting config file, the user will have to rely on a document which could be out of date with respect to the config file. Wouldn't it make a lot of sense for the description property of a setting to be put into the app.config as a comment?

The only way I can guarantee that the settings are accurately documented is to forego the Settings class. In fact, comments in the config file are impossible with the settings class. Any comments that you stick in manually get wiped out on whenever you make a change in your settings class.
14.11.2011
Jürgen Luhr 7,1k 2 9

Stelle deine Vs2008-Frage jetzt!