私は何かが欠けているに違いありません...どのように例外がスローされる可能性がありますが、例外に続くコードはまだデバッガでヒットしますか?例外の後にコードがどのように実行されますか?
private UpdaterManifest GetUpdaterManifest()
{
string filePathAndName = Path.Combine(this._sourceBinaryPath, this._appName + ".UpdaterManifest");
if (!File.Exists(filePathAndName))
{
// This line of code gets executed:
throw new FileNotFoundException("The updater manifest file was not found. This file is necessary for the program to run.", filePathAndName);
}
UpdaterManifest updaterManifest;
using (FileStream fileStream = new FileStream(filePathAndName, FileMode.Open))
{
// ... so how is it that the debugger stops here and the call stack shows
// this line of code as the current line? How can we throw an exception
// above and still get here?
XmlSerializer xmlSerializer = new XmlSerializer(typeof(UpdaterManifest));
updaterManifest = xmlSerializer.Deserialize(fileStream) as UpdaterManifest;
}
return updaterManifest;
}
おそらく、あなたは遠くチェーンまで例外をキャッチ? –
多分あなたは別のスレッドを見ていますか? – Strillo
このコードは複数のスレッドからアクセスされますか? –