>Are you really just swallowing any exception ?
The exception is there because on local Web site, such as on my PC, for testing environment, this is Web sites under virtual directories and this code will generate an error. This code does not generate an error on domain Web site.
But, if there would be an error, it would just skip it and proceed by logging an empty value in the application pool name field I have in a specific table. If I can extract it, I will have a value.
The purpose of the post was to verify if such code could trigger a freeze in the execution. This approach is used by other developers but I am not sure if it is that safe. That is why I ask. If I have a doubt on it, I would simply put it in comments for now.
But, last night, we got an alert on the same server that it stopped responding for 6 minutes. So, it seems something is wrong with that server and it seems unlikely this is in cause. Also, that code only executes on IIS recycle or on startup. What happened overnight, was at 3h00 thus three hours before the IIS recycle would have taken place. So, this code is surely not involved in that second situation.