Azure function V2 throws error for DLL used in reference library project

0

I have created azure function in V2 (.net Core). I have added library project reference to this azure function. When I try to call function of library project related with cache it throws error as below :

"Could not load file or assembly 'System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)"

I did not see any issue for azure function V1 but change from V1 to V2 causes issue. I tried to install System.Runtime.Caching from nuget package manager (which was not required in case of V1 and lowest version available to install in nuget manager is 4.5.0.0), error throws as :

The type initializer for 'LibraryProj.CacheBR' threw an exception.

Can some one guide me here please ?

V1 : .NET frameework 4.6 V2 : .NET core 2.1

azure-functions

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0