SOLVED - System.Transactions.Diagnostics.DiagnosticTrace threw an exception in C#

While coding, usually we face different issues. Here one of the errors I faced while trying to execute the following code. Here, I tried to fetch data from SQL database,

Error: {"The type initializer for 'System.Transactions.Diagnostics.DiagnosticTrace' threw an exception."}




Solution: Open app.config

Move <configSections> section just below the <configuration> code as follows.





Please drop a comment still the issue persists for you.

Comments