当我安装 Windows 服务时,当我尝试重新启动服务时出现此错误。我怀疑 log4net 引起了一些问题。我检查了 log4net 日志文件仍然可以继续附加,根据安装程序在目标机器上的文件系统设置存在其他目录。
Application: SPIDFileWatcher.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.DirectoryNotFoundException
Stack:
at System.IO.__Error.WinIOError(Int32, System.String)
at System.IO.FileSystemEnumerableIterator`1[[System.__Canon, mscorlib, Version=4.0.0.0,Culture=neutral, PublicKeyToken=b77a5c561934e089]].CommonInit()
at System.IO.FileSystemEnumerableIterator`1[[System.__Canon, mscorlib, Version=4.0.0.0,Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.String, System.String, System.String, System.IO.SearchOption, System.IO.SearchResultHandler`1<System.__Canon>)
at System.IO.Directory.EnumerateFiles(System.String, System.String, System.IO.SearchOption)
at FileWatchingService.FileWatcher..ctor()
at FileWatchingService.WatchService.OnStart(System.String[])
at FileWatchingService.WatchService.OnDebug()
at FileWatchingService.Program.Main()
我怎样才能解决这个问题?