升级到4.6.2无法检查File.Exists [英] Upgrading to 4.6.2 fails File.Exists check

查看:62
本文介绍了升级到4.6.2无法检查File.Exists的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将.NET项目从4.5.1升级到4.6.2。每当我进行System.IO.File.Exists检查时,即使文件确实存在,它也总是返回false。当我将web.config中的httpruntime更改为低于4.6.2的任何版本时,File.Exists可以正常工作
。有没有人遇到过这种情况。为什么将.net版本更改为4.6.2,停止识别文件是否存在。 


解决方案

请注意
File.Exists 还会检查权限。也许这些方面得到了改善。您是否尝试读取该文件,即使
File.Exists 返回 false


I upgraded my .NET project from 4.5.1 to 4.6.2. Whenever I am doing a System.IO.File.Exists check, it always returns false even though the file does exist. When I change my httpruntime in the web.config to any version lower than 4.6.2, the File.Exists works fine. Has anybody come across this scenario. Why does changing .net version to 4.6.2 , stop identifying if a file exists or not. 

解决方案

Note that File.Exists also checks for permissions. Maybe these aspects were improved. Have you tried to read the file even if File.Exists returns false?


这篇关于升级到4.6.2无法检查File.Exists的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆