Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

257
Vistas
Could not load file or assembly Newtonsoft.Json in Docker container, ASP.NET 6

After updating to .NET 6 I get this error when running my ASP.NET app inside a Docker container:

An unhandled exception was thrown by the application.
System.IO.FileNotFoundException: Could not load file or assembly \u0027Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed\u0027. The system cannot find the file specified.  File name: \u0027Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed\u0027
at Cadmean.RPC.ASP.FunctionController.GetFunctionCall()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine]
...

Here is my Dockerfile:

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /app

COPY . ./

RUN dotnet publish -c Release -o out

FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "DealCrackerBackend.dll"]

The library Newtonsoft.Json 13.0.1 is references from a different project (class library) in the solution. The referenced nuget package Cadmean.RPC is also using the same version of Newtonsoft.Json 13.0.1.

The app compiles and runs but when I make a request this happens.

The app works as before on macOS with .NET 6.0.100.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

I had the same issue and was also related to my unit test project. In my case, I'm using nUnit and it has Microsoft.NET.Test.Sdk version 17.1.0-preview and this references Newtonsoft.Json version 9, but all other projects have version 13. For now, just removed the unit test project from the solution

over 4 years ago · Santiago Trujillo Denunciar

0

Apparently, the issue is related to Newtonsoft.Json package and net6 but only in Docker (Linux) environment. We replaced that with System.Text.Json and it was resolved.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda