[英]C# applicationHost.config not found but exists
I'm getting a strange error when accessing applicationsHost.config.访问applicationsHost.config 时出现一个奇怪的错误。 I've run VisualStudio in administrator mode and trying to access
我已经在管理员模式下运行 VisualStudio 并尝试访问
C:\Windows\System32\inetsrv\config\applicationHost.config
but I get exception FileNotFound while file exists.但是文件存在时出现异常 FileNotFound 。
var file = @"C:\Windows\System32\inetsrv\config\applicationHost.config";
var fileExist = System.IO.File.Exists(file); //it always returns false
var fi=System.IO.File.OpenRead(file); //Throws FileNotFound exception
I've tested on VS2013 and VS2017 on Windows 10. I don't get any error related to permission and even I've added Everyone to the folder to be sure it's related to that.我已经在 Windows 10 上测试了 VS2013 和 VS2017。我没有收到任何与权限相关的错误,甚至我已经将所有人添加到文件夹中以确保它与此相关。
It turned out it's related 'File System Redirection' on Windows 8.1 onward.原来它与 Windows 8.1 及以后的“文件系统重定向”有关。 So %windir%\System32 would be redirected to %windir%\SysWOW64 Thanks to @NGambit I had to change config type to x64 to be able to access applicationhost.config
所以 %windir%\System32 将被重定向到 %windir%\SysWOW64 感谢@NGambit 我必须将配置类型更改为 x64 才能访问 applicationhost.config
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.