I running a C# MVC website written on C# for quite long time. Recently, I've noticed this log message in my logger data:
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)
I also know:
ASP.global_asax
file.As you can see, nothing in this call-stack is in my code. Therefore, I don't know how to repro this or solve this.
How do you recommend me to solve this? Any tip will be helpful.
Looking at the source code, this exception is triggered by the framework itself.
It tries to enumerate all files in the HttpRuntime.AppDomainAppPath. It looks like this path is not always available in your scenario, which seems a little strange. Where are you hosting your files?
I suggest you to log the value of HttpRuntime.AppDomainAppPath
and search from there. I think it will be a rather unusual value...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With