Azure Function: Could not load file or assembly Newtonsoft.Json - c#

I'm aware that this issue is widely covered on the web and at stackoverflow but I could do with some extra help to sort this issue. I'm getting a runtime error relating to loading Newtonsoft, see below;
[11/07/2020 18:37:17] A ScriptHost error has occurred
[11/07/2020 18:37:17] Exception while executing function: Alerts. EmailSender: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. mscorlib: Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
[11/07/2020 18:37:17] Exception while executing function: Alerts
[11/07/2020 18:37:17] Exception while executing function: Alerts. EmailSender: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. mscorlib: Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
[11/07/2020 18:37:17] Function completed (Failure, Id=850be268-8e38-409d-aa59-fa071567779e, Duration=10672ms)
I have followed and implemented binding redirects as described in this blog. My azure function is a verion 1 function with .net472, im using Microsoft.NET.Sdk.Functions Version 1.0.36.
The exception occurs when a call to a referenced project is made, in that project there is a reference to Newtonsoft 10.0.2.
Any help is greatly appreciated - thanks!

You'll need to downgrade Newtonsoft to 9.0.1. You'd better read about the v1/v2 breaking changes and rewrite your function to .net core.
https://github.com/Azure/app-service-announcements/issues/129

Related

Grpc Unity Could not load signature of Google.Protobuf

I just downloaded the latest version of unity package grpc but I have encountered the following issue:
Error: Could not load signature of Google.Protobuf.ByteString:get_Span due to: Could not load file or assembly 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. assembly:System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 type:<unknown type> member:(null) signature:<none> Unloading broken assembly Assets/Plugins/Google.Protobuf/lib/net45/Google.Protobuf.dll, this assembly can cause crashes in the runtime
Unity Version: 2019.3.0f1
Does anyone have a solution for this? Any help appreciated.

'Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

I am a newbie and just created a new project of type: ASP.NET Core Web Application (.NET Core) and let VS preload all the defaults. I changed nothing, except set index.cshtml the startup. It built ok, but has a run-time error of:
System.IO.FileNotFoundException occurred
HResult=0x80070002
Message=Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Call Stack (last item):
ntdll.dll!NtWaitForSingleObject() Unknown
What is happening here, and how can it be fixed?
Using Visual Studio Installer, selecting the Repair option solved the problem.

mod-mono-server4 assembly System.IO.FileNotFoundException

I serached but I didn't found how to resolve this problem. I have ASP.NET application with System.Web.DataVisualization.dll. Dll is in bin folder, simple ASP.NET apps are working but when I try to run this application I got error:
System.IO.FileNotFoundException Could not load file or assembly
'System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35' or one of its dependencies
also I have MONO_PATH=/usr/lib/mono/gac:/app_dir/bin

The type initializer for 'Neo4jClient.GraphClient' threw an exception

I'm new to Neo4j, when I tried to connect to Neo4j server through neo4jclient in the C#, my code have faced to an exception such as image below:
the Error is :
The type initializer for 'Neo4jClient.GraphClient' threw an
exception.
and the InnerException is:
Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0,
Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its
dependencies. The system cannot find the file
specified.":"Newtonsoft.Json, Version=4.5.0.0, Culture=neutral,
PublicKeyToken=30ad4fe6b2a6aeed
-> also The http://localhost:7474/db/data is the root.
How can I solve this problem?
You can clearly read in the inner exception that it can't load the assembly Newtonsoft.Json. Reference Newtonsoft.Json, preferable by using NuGet.

Error: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=9.0.0.0

I am getting this error that is related to ReportsViewer. I need to eliminate all references to this library. So where do I need to start deleting the references?
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
<add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
I had a similar issue. Look at your page directives and the bin directory for a Report file. Then look in your web.config. Your app should compile fine after that.

Categories

Resources