In Visual Studio console app, code work but not when I use it in an Azure function app

Copper Contributor

In a Visual Studio console app, I have the following code and it works

var accessTokenInfo = Configuration.Default.ApiClient.PostToken("", "*****");


But when I use the same line of code in an Azure function app, it gives the error


System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.' FileNotFoundException: Could not load file or assembly 'System.Text.Json, Version=, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

0 Replies