c# – Visual Studio 2022 Performance Profiler not working correctly when program is pointed to PostgreSQL vs SQLite


I have a non-trivial program written in C# and using EF Core. I have the ability to either point this program towards a PostgreSQL database hosted remotely, or a SQLite database stored locally.

When I have the program pointed towards PostgreSQL, the profiler does not seem to work correctly. There only appear to be native code calls in the CPU Usage tab, and there are no queries in the queries tab. I tried running it in both debug and release mode, as well as switching off all options except for CPU usage, and then queries to isolate them.

When I switch to using the SQLite database, everything works as expected. I can see all my function calls in the CPU Usage tab, and I can see all the queries in the queries tab. Nothing changes in the code besides the line in the DbContext switching from

optionsBUilder.UseNpgsql(connectionString);

to

optionsBuilder.UseSqlite(connectionString);

and a change to one entity that deals with the difference in how PostgreSQL and SQLite deal with DateTime.

Leave a Reply

Your email address will not be published. Required fields are marked *