'When moving project from windows service to azure functions facing problems with project Dlls

Most of the migration part from windows service to Azure functions were fine. Until I got stuck with Data Layer project where we are using ADO.net to create Database instance DatabaseFactory.CreateDatabase("ConnectionString"). When I debug I was getting Microsoft.Practices.EnterpriseLibrary.Data.dll and Microsoft.Practices.Unity.dll and Microsoft.Practices.Unity.Interception.dll errors I have fixed these issues by adding those Dlls in the package folder of the Azure functions project in VS 2019.

But still when I try to debug the DatabaseFactory.CreateDatabase("ConnectionString") line its throwing "Activation error occured while trying to get instance of type database, key" error.

For windows service its working fine and I have compared the Dlls as well and all are same. When working with azure functions its throwing "Activation error occured while trying to get instance of type database, key" error.

I am unable to figure out how to fix this issue.

Please let me know if you need any more information.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source