You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Repository navigation
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
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"
@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.
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.
Activity
Shwetap05 commentedon Mar 20, 2019
@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.
Shwetap05 commentedon Apr 4, 2019
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 commentedon Apr 25, 2019
Hitting this same issue as well.
Shwetap05 commentedon May 9, 2019
PR is out for the fix #208
ShubhamRane commentedon Jul 6, 2020
I can see that the above PR is merged. Is this issue resolved?. I am still facing this issue