0
FileStream을 만들 때 임의의 FileNotFoundExceptions에 문제가 있습니다. 파일 경로가 정확하고 파일이 존재하지만 임의의 시간에 FileNotFoundException이 나옵니다. 어떻게 자세히 디버깅 할 수 있습니까? ,debug FileNotFoundException depth C#
internal static FInstance ReadAndDecrypt(string key, string fiId)
{
FileInfo fileInfo = new FileInfo(FullFilePath(fiId));
FileStream fileStream = null;
CryptoStream cryptoStream = null;
GZipInputStream zipStream = null;
try
{
int time = Environment.TickCount;
fileStream = new FileStream(fileInfo.FullName, FileMode.Open, FileAccess.Read);
var serializer = new XmlSerializer(typeof(FInstance));
var FInstance = (FInstance)serializer.Deserialize(fileStream);
return Instance;
}
catch (Exception e)
{
Log.Error(e);
return null;
}
finally
{
if (fileStream != null)
fileStream.Close();
}
}
나는이 발생할 수 아무것도 생각할 수 없다 : 나는 윈도우 모바일 6 프로젝트를 실행하고 있는데 이것은 예외 :이 예외를 throw하는 방법입니다
System.IO.FileNotFoundException: Could not find file '\Program Files\xxx\xxx\xxx-11133.bin'.
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
더 깊은 디버깅 방법이 있습니까?
동일한 파일에 대해 여러 번 호출 하시겠습니까? 해당 파일을 수정하는 다른 프로그램/코드가 없다고 확신합니까? – Default
@Hans, Windows CE에는 드라이브 문자가 없습니다. – ctacke