Ho bisogno di chiamare un asyncmetodo in un catchblocco prima di lanciare di nuovo l'eccezione (con la sua traccia dello stack) in questo modo: try { // Do something } catch { // <- Clean things here with async methods throw; } Ma purtroppo non è possibile utilizzare awaitin una …
Ho il codice seguente: WebClient wc = new WebClient(); string result; try { result = await wc.DownloadStringTaskAsync( new Uri( "http://badurl" ) ); } catch { result = await wc.DownloadStringTaskAsync( new Uri( "http://fallbackurl" ) ); } Fondamentalmente voglio scaricare da un URL e quando fallisce con un'eccezione voglio scaricare da un …
We use cookies and other tracking technologies to improve your browsing experience on our website,
to show you personalized content and targeted ads, to analyze our website traffic,
and to understand where our visitors are coming from.
By continuing, you consent to our use of cookies and other tracking technologies and
affirm you're at least 16 years old or have consent from a parent or guardian.