This is insufficient information. Please provide more details such as whether this is a new project or existing one, one version of VS you're using, what version of NET you're targeting, what kind of project it is, etc. NewtonSoft is a Nuget package so you need to ensure you are importing that package (and version) using NuGet Package Manager inside VS. If you're using the old packages.config approach then you need to ensure that file is available. If you have updated your project then you need to ensure the package is still compatible and probably update to the newer package.
Could not load file or assembly
Error while building dotnet project.
Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(169,5): error : Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=XXXXXX' or one of its dependencies. The system cannot find the file specified
2 answers
Sort by: Most helpful
-
-
Pinaki Ghatak 3,830 Reputation points Microsoft Employee
2024-02-24T21:28:54.23+00:00 Hello Khan, Saiful
It seems like your project is unable to find the
Newtonsoft.Json
assembly with version13.0.0.0
. This could be due to a few reasons:- The specified assembly is not installed in your project. You can install it via NuGet package manager in Visual Studio or by using the Package Manager Console:
Install-Package Newtonsoft.Json -Version 13.0.0
The assembly is installed but the version is different from
13.0.0.0
. You can check the version ofNewtonsoft.Json
in your project and update it if necessary.The assembly is not correctly referenced in your project. Check the
.csproj
file orpackages.config
file in your project to ensure that the reference is correct.If you’re working in a team, it’s possible that the assembly exists on a team member’s machine but not on yours. In this case, you should ensure that all necessary packages are included in your source control.
If this is not what you are looking for, please provide more details.
If this information provided here helps solve your issue, please tag this as answered, so it helps further community readers, who may have similar questions.