I need to miss something ... How can an exception be thrown, but the code following the exception still gets into the debugger?
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; }
source share