Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Newtonsoft.Json failing to load in ADO build task #202

Open

Description

Hi,

I have been attempting to add an OpenAPI build task to my Azure DevOps pipeline, but am currently stuck on receiving an error whenever I attempt to build my document:

ExceptionType: FileLoadException || Message: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.
    GET /api/v1/xxx || ExceptionType: AddingSchemaReferenceFailedException || Message: Adding schema "xxx.ValidationError" to the schema reference registry failed with the error: Adding schema "System.Collections.Generic.List_xxx.ApiError_" to the schema reference registry failed with the error: Adding schema "xxx.ApiError" to the schema reference registry failed with the error: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621)...

I'm not sure how this error is arising - I've imported the same version of Newtonsoft.Json via NuGet in every project in my solution, and I import all .dll dependencies from the same dotnet build task (project info redacted):

Found: "C:\vsts-agent-win-x64-2.144.0\_work\4\s\xxx\xxx.xml"
Searching for pattern "xxx\bin\Release\**\publish\xxx*.dll" under "C:\vsts-agent-win-x64-2.144.0\_work\4\s" path.
Found: "C:\vsts-agent-win-x64-2.144.0\_work\4\s\xxx\bin\Release\netcoreapp2.2\publish\xxx1.dll", "C:\vsts-agent-win-x64-2.144.0\_work\4\s\xxx\bin\Release\netcoreapp2.2\publish\xxx2.dll", "C:\vsts-agent-win-x64-2.144.0\_work\4\s\xxx\bin\Release\netcoreapp2.2\publish\xxx3.dll", "C:\vsts-agent-win-x64-2.144.0\_work\4\s\xxx\bin\Release\netcoreapp2.2\publish\xxx4.dll"
Searching for pattern "xxx\bin\Release\**\publish\Newtonsoft.Json.dll" under "C:\vsts-agent-win-x64-2.144.0\_work\4\s" path.
Found: "C:\vsts-agent-win-x64-2.144.0\_work\4\s\xxx\bin\Release\netcoreapp2.2\publish\Newtonsoft.Json.dll"

Is there something I might be missing?

Activity

  1. Shwetap05 commented on Mar 20, 2019

    @Shwetap05
    Member

    @jublair I am working on a fix in the library that should try to resolve the assembly conflicts if found any and hoping that should fix this Azure DevOps task issue too, i will keep you updated on the progress made.

  2. Shwetap05 commented on Apr 4, 2019

    @Shwetap05
    Member

    I will have a PR out sometime over weekend. Though do not have an ETA on integration to task yet. But as soon as changes are in the library we will start work on updating the Task to consume the changes.

  3. prafullbhosale commented on Apr 25, 2019

    @prafullbhosale

    Hitting this same issue as well.

  4. Shwetap05 commented on May 9, 2019

    @Shwetap05
    Member

    PR is out for the fix #208

  5. ShubhamRane commented on Jul 6, 2020

    @ShubhamRane

    I can see that the above PR is merged. Is this issue resolved?. I am still facing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions