ASP.NET OpenWebConfiguration schlägt fehl

Ich versuche, die Webkonfiguration zu öffnen, damit ich sie verschlüsseln / entschlüsseln kann, aber sie schlägt fehl. Ich mache dies in Web Developer 2010 Express auf meinem Desktop, wo ich eine Website als Dateisystem einrichte. Hier sind die Möglichkeiten, die ich ausprobiert habe.

Configuration config = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath);

Configuration config = WebConfigurationManager.OpenWebConfiguration("~");

Configuration config = WebConfigurationManager.OpenWebConfiguration("/");

Configuration config = WebConfigurationManager.OpenWebConfiguration("/web.config");

Configuration config = WebConfigurationManager.OpenWebConfiguration(/AppNameHere);

Jedes Mal, wenn ich eine Fehlermeldung erhalte: Beim Laden einer Konfigurationsdatei ist ein Fehler aufgetreten: Der Pfad '/' konnte nicht zugeordnet werden.

Irgendwelche Ideen?

Antworten auf die Frage(2)

Ihre Antwort auf die Frage