Last post Sep 03, 2020 02:49 PM by n0kx1
Sep 03, 2020 01:16 PM|n0kx1|LINK
I have a very simple, single page Blazor Server application that is hosted on a PC with MySQL server running on it. The application will simply grab a record from the database and display the results on the page.
Everything is setup on the PC to where the Blazor Server application displays properly, and I can connect to the MySQL database using my WPF applications, but for some reason I cannot get the Blazor Server application to connect. I've tried using "localhost"
and the IP address of the PC but nothing seems to be working.
The only error I'm really seeing is: Exception thrown: 'System.TypeInitializationException' in MySql.Data.dll
Is there anything special that needs to happen to make the Blazor Server application connect to MySQL?
Sep 03, 2020 01:32 PM|PatriceSc|LINK
It's best to always provide exception.ToString() than exception.Message. For example a full message sample could be found at:
As you can see it is much easier to see what is missing. For now my guess is that you miss some dependency as well (it was installed using nuget ?) but guessing which one would be very hard (or someone that really had the same
problem and that by chance would miss as well the exact same dependency than he did).
Sep 03, 2020 02:49 PM|n0kx1|LINK
A missing dependency seemed to be the issue. I had the MySQL DLLs in a library I had created but I guess Blazor needed me to pull those in via NuGet separately.