Type Initializer exception being thrown when launching WPF application


I am pretty new to Windows desktop development, so please let me know if this is a repeat question.

Our application is using WPF/Telerik UI, targeting DotNet Framework 4.7.2, & using EF Core 3.1.5.

It runs perfectly in Visual studio and appears to publish without error (both by 1 click and MSI package). However when I try to run the application I receive the following error in a popup window: "Unable to load DLL 'Microsoft.Data.SqlClient.SNI.x86.dll': The specified module could not be fount. (Exception from HRESULT: 0x8007007E)"

I have attempted to install the SQL Client SNI Nuget package, but apparently no version of that package targets the version of DotNet Framework we are using.

I am not sure what code would be helpful in diagnosing this issue, but would be happy to include any you think might be helpful.

I am especially confused why the application is suddenly in need of a nonexistant package when it is published and installed, but it runs fine without it when started from visual studio.

Thank you. This has stopped me from deploying an internal tool for my company, and so I would be really grateful for any help.

asked on Stack Overflow Jun 17, 2020 by mark mahowald

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0