Published WIndows Console App fails with System.ComponentModel.Win32Exception at Microsoft.Data.SqlClient.SNINativeMethodWrapper..cctor()

Viewed 58

I have a Windows Console application that accesses our SQL database. This app works fine from VS2019, the debug folder and the release folder. However, if I publish this app, the installed version fails with the exception shown below.

I do note the following differences between the installed location (\AppData\Local\2.0\xxx\yyy) and the \Release folder:

  1. The \Release folder has SNI files in the \x86 and \64 directories, but the installed directory is missing this information. How do I include this in the manifest? I suspect that this is the main issue causing the exception. enter image description here

  2. The manifest file in the installed location is missing information related to Identity - not sure if this is a concern, but perhaps it is? enter image description here

Application: SmartRView Configuration.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.ComponentModel.Win32Exception at Microsoft.Data.SqlClient.SNINativeMethodWrapper..cctor()

Exception Info: System.TypeInitializationException at Microsoft.Data.SqlClient.SNINativeMethodWrapper.SNIInitialize() at Microsoft.Data.SqlClient.SNILoadHandle..ctor() at Microsoft.Data.SqlClient.SNILoadHandle..cctor()

Exception Info: System.TypeInitializationException at Microsoft.Data.SqlClient.TdsParser..cctor()

0 Answers
Related