मुझे कुछ याद आना चाहिए ... अपवाद कैसे फेंक दिया जा सकता है, फिर भी अपवाद के बाद कोड डीबगर में हिट हो जाता है?अपवाद के बाद कोड निष्पादन कैसे किया जाता है?
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
क्या यह कोड एकाधिक धागे से एक्सेस किया गया है? –