Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Functions Errro - Could not load file or assembly System.Configuration.ConfigurationManager, Version=4.0.3.0

I am working on Azure Functions and these are created in .Net Core version 3.1 whereas the other libraries are written in .Net Framework 4.8. While executing the functions, I am getting following error -

System.Private.CoreLib: Exception while executing function: XXXXXX. System.Private.CoreLib: One or more errors occurred. (The type initializer for 'XXXXX' threw an exception.). XXXX.Service: The type initializer for 'XXXXX.Service.XXXXX' threw an exception. XXXX.Service: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

Suggestions would be appreciated.

like image 911
Anil Avatar asked Nov 15 '22 14:11

Anil


1 Answers

You can work around the issue by adding the _FunctionsSkipCleanOutput to the project file.

<PropertyGroup>
  <_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup>
like image 114
Chris Stubbs Avatar answered Dec 30 '22 13:12

Chris Stubbs