ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
CKCody Kirsch24/06/2020

I am making an addin that needs to connect to a database through a .NET Core class library that uses Entity Framework Core. The addin is also a .NET Core project. The addin will need to read from the database when drawings are opened,  update custom properties from the data, and write to the database after the drawing is closed.


The addin is registered with SolidWorks but when running regsvr32 I get a "dllregisterserver error 0x80131604". The ConnectToSW function does get called by SolidWorks and the DbContext object can be created but an exception is thrown when tables are querying. I have tried querying data before and after

The message is "The type initializer for 'Microsoft.Data.SqlClient.SqlConnection' threw an exception."

The exception stack is

'System.PlatformNotSupportedException' in System.Configuration.ConfigurationManager.dll
'System.Configuration.ConfigurationErrorsException' in System.Configuration.ConfigurationManager.dll
'System.Configuration.ConfigurationErrorsException' in System.Configuration.ConfigurationManager.dll
'System.InvalidOperationException' in Microsoft.Data.SqlClient.dll
'System.TypeInitializationException' in Microsoft.Data.SqlClient.dll
'System.TypeInitializationException' in Microsoft.EntityFrameworkCore.Relational.dll