Skip to content
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
ghost opened this issue Mar 20, 2019 · 6 comments
Open

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

ghost opened this issue Mar 20, 2019 · 6 comments

Comments

@ghost
Copy link

ghost commented Mar 20, 2019

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?

@Shwetap05
Copy link
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.

@ghost
Copy link
Author

ghost commented Apr 2, 2019

Any updates?

@Shwetap05
Copy link
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.

@prafullbhosale
Copy link

Hitting this same issue as well.

@Shwetap05
Copy link
Member

PR is out for the fix #208

@ShubhamRane
Copy link

ShubhamRane commented Jul 6, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants