0

I am working on a mvc5 project that wasn't created by me. The website itself works fine but I am seeing a lot of exceptions being thrown in the debug output window. It bugs me that I have no clue where the come from. But the website is also extremely slow to start and it runs slowly. I am wondering if the exceptions cause the website to be so slow. Here are some of the exceptions I am seeing:

Exception thrown: 'System.InvalidOperationException' in Microsoft.Practices.Unity.dll
Exception thrown: 'Microsoft.Practices.Unity.ResolutionFailedException' in Microsoft.Practices.Unity.dll
Exception thrown: 'System.Reflection.ReflectionTypeLoadException' in mscorlib.dll
Exception thrown: 'System.IO.FileLoadException' in mscorlib.dll
Exception thrown: 'System.Reflection.ReflectionTypeLoadException' in mscorlib.dll
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll
Exception thrown: 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' in Microsoft.CSharp.dll
Exception thrown: 'System.Web.HttpException' in System.Web.dll
Exception thrown: 'System.InvalidOperationException' in Microsoft.Practices.Unity.dll
Exception thrown: 'System.IO.FileNotFoundException' in System.Xml.dll
Exception thrown: 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' in Microsoft.CSharp.dll
Exception thrown: 'System.Xml.XmlException' in System.Xml.dll
Exception thrown: 'System.Web.HttpException' in System.Web.dll
Exception thrown: 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' in Microsoft.CSharp.dll

After logging in to the application, after leaving any debuggable code it takes up to one minute before the user is taken to the homepage. In the mean time, up to 50 xml exceptions are thrown. I want to know if this is related but I have no clue how to figure this out.

I have enabled debugging on visual studio but none of the exceptions show up in the VS logfile or in the application logfile. Does anybody have an idea what is going on? How can I resolve this issue?

Saravanan
  • 7,637
  • 5
  • 41
  • 72
Dennis
  • 1
  • 3
  • 1
    Have you enabled logging system exceptions. Also the stacktrace is the real place that helps you understand what is going on. Can you please post any full exception message with stack trace for us to help – Saravanan Apr 26 '20 at 10:58
  • I didn't enable logging system exceptions. I opened the Exception settings window but there doesn't seem to be an option for system exceptions. I also looked for xlmexceptions but they weren't there either. Also, I don't have the stacktrace. Those lines in the message above are literally all I have. That is why I am so frustrated. I am looking for ways to get more diagnostic information. – Dennis Apr 26 '20 at 12:04
  • 1
    configure [VS to stop at the exceptions](https://learn.microsoft.com/en-us/visualstudio/debugger/managing-exceptions-with-the-debugger?view=vs-2019#tell-the-debugger-to-break-when-an-exception-is-thrown) – magicandre1981 Apr 26 '20 at 13:42
  • I was able to stop the debugger at the location where the xmlexception occurred. It turns out there was a method that tried to parse a string to xml. The code was executed in a try catch block with an empty catch block. Also, the string never contains xml which explains why there were so many exceptions thrown. I am now troubleshooting the other exceptions the same way. Thanks for the help. – Dennis Apr 27 '20 at 11:59

0 Answers0