Last post Apr 20, 2020 09:05 AM by Sherry Chen
Apr 19, 2020 06:14 PM|SSK_Nani|LINK
I am using this namespace using Microsoft.Practices.EnterpriseLibrary.Data; to connect the database.
public static Database CreateDatabase(string connectionString,bool isEncrypted=false)
decryptedConnectionString = DecryptConnectionString(connectionString);
decryptedConnectionString = connectionString;
Database database = new SqlDatabase(decryptedConnectionString);
throw new Exception("Error reading database details. Error:" + ex.Message);
At this line Database database = new SqlDatabase(decryptedConnectionString);, I am getting below exception.
I am using Asp.Net core 3.0 Web API
System.TypeInitializationException: 'The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Data.Database' threw an exception.'
FileNotFoundException: Could not load file or assembly 'System.Management, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
Apr 19, 2020 06:18 PM|mgebhard|LINK
I'm pretty sure you need to drop to ASP.NET Core 2.1 to use Enterprise Library 6. ASP.NET 3.0 is not compatible with .NET Framework and it appears Enterprise library is no longer supported.
Apr 20, 2020 09:05 AM|Sherry Chen|LINK
Hi SSK_Nani ,
From the link mgebhard provided, it seems that ASP.NET Core 3.0 does not support Enterprise library .
For your issue, it is more related with Enterprise Library which is a third party product, I would suggest you submit your issue for more help below: