Chrome Network Error Download Files on C# or Vb.Net

error_network_chrome
Estándar

With the last update of Google Chrome (Versión 53.0.2785.116 m at this point) many Microsoft developers get the surprise of download buttons of their web applications start to fail with Network Error.

This maybe cause by the flush() and close() behaviour on our code and the use of this methods on download functions.

One of the solutions that i find to fix it, its to change flush() and close() to end() adding a empty System.Threading.ThreadAbortException catch to avoid problems on execution.

C#

...            
//Response.Flush();
//Response.Close();
Response.End();
}
catch (System.Threading.ThreadAbortException)
{}
.....

 

Vb.Net

Try
.....
'Response.Flush()
'Response.Close()
Response.End()
Catch exx As System.Threading.ThreadAbortException
End Try

 

I hope this work for you, share and comment this post.