No1*_*ver 7 c# asp.net asp.net-mvc ioexception
我在C#上运行一个C#MVC网站很长一段时间.最近,我在记录器数据中注意到了这条日志消息:
System.IO.IOException: The network name cannot be found.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileSystemEnumerableIterator`1.CommonInit()
at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
at System.IO.Directory.EnumerateFiles(String path)
at System.Web.WebPages.Deployment.WebPagesDeployment.AppRootContainsWebPagesFile(String path)
at System.Web.WebPages.Deployment.PreApplicationStartCode.OnChanged(String key, Object value, CacheItemRemovedReason reason)
at System.Web.Caching.CacheEntry.CallCacheItemRemovedCallback(CacheItemRemovedCallback callback, CacheItemRemovedReason reason)
Run Code Online (Sandbox Code Playgroud)
我也知道:
ASP.global_asax文件中抛出此异常.如您所见,此调用堆栈中没有任何内容存在于我的代码中.因此,我不知道如何重复这个或解决这个问题.
你怎么建议我解决这个问题?任何提示都会有所帮助.
小智 -4
网络可能已关闭,您可以通过简单地添加一个捕获来捕获此异常并显示一条消息,表明网络名称的主机已关闭,并且它应该在再次尝试您正在执行的任何操作之前解决网络问题来解决此问题。