Why I get FileNotFound using this code? if I move the applicationHost.config file to another directory such as c:\temp it will read just fine.
const string IIS_CONFIG_FILE =
@"C:\Windows\System32\inetsrv\config\applicationHost.config";
string xml = File.ReadAllText(IIS_CONFIG_FILE);
XDocument doc = XDocument.Load(new StringReader(xml));
It has to do with the directory because I can't even open a simple Test.xml file there. I used Process Monitor from SysInternals but nothing is traced. Very weird.
Thank you Max
答案 0 :(得分:0)
如果您尝试在32位应用程序中读取此类仅64位文件,则Windows会将您引导至等效的WOW64文件路径,该路径确实不存在。