Мне что-то не хватает ... Как можно исключить исключение, но код, следующий за исключением, все еще попадает в отладчик?Как выполняется код после исключения?
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
Доступен ли этот код из нескольких потоков? –