[2.0] App_Data File Not Found Exception
Bonjour,
J'ai placé un document Xml dans le répertoire App_Data de mon site web.
Ensuite dans le code j'essais de faire ceci :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| if (!string.IsNullOrEmpty(reportName))
{
XmlDocument _doc = new XmlDocument();
try
{
_doc.Load(ConfigurationManager.AppSettings["ReportingDataXml"].ToString());
XmlNode _node = _doc.SelectSingleNode(@"/Reporting/Reports/Report[@ReportName="+reportName+"]");
if (_node != null)
{
_path = _node.Attributes["reportPath"].ToString();
}
}
catch {}
} |
avec :
Code:
1 2 3
| <appSettings>
<add key="ReportingDataXml" value="~/App_Data/ReportingData.xml"/>
</appSettings> |
lorsque j'exécute le code j'ai l'exception ci-dessous :
Citation:
Could not find a part of the path 'C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\~\App_Data\ReportingData.xml'.
J'ai du louper quelque chose.... :roll: mais quoi :?
Stéphane