dotnet build and custom target with a depenedency on Json.Net: File name: 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
See original GitHub issue@abatishchev commented on Thu Jun 21 2018
Hi,
I have a project (Service Fabric if that matters) which uses a custom props and targets files which call a DLL winch has a dependency on Newtonsoft.Json.dll which is shipped alongside.
When I build inside VS2017 I have no errors.
But when I run dotnet build
I’m getting this:
BuildLayout.targets(21,5): error MSB4018: The “GenerateArmTemplateTask” task failed unexpectedly. [DeploymentAgent.sfproj] BuildLayout.targets(21,5): error MSB4018: System.IO.FileLoadException: Could not load file or assembly ‘Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’. Could not find or load a specific file. (Exception from HRESULT: 0x80131621) [DeploymentAgent.sfproj] BuildLayout.targets(21,5): error MSB4018: File name: ‘Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’ [DeploymentAgent.sfproj] BuildLayout.targets(21,5): error MSB4018: at BuildLayout.Generators.TemplateGenerator.Generate(BuildLayoutOptions args, ApplicationManifestType appManifest) [DeploymentAgent.sfproj] BuildLayout.targets(21,5): error MSB4018: at BuildLayout.Generators.BuildLayoutGenerator.Generate(BuildLayoutOptions args) in e:\bt\921388\repo\src\product\buildlayout\Generators\BuildLayoutGenerator.cs:line 23 [DeploymentAgent.sfproj] BuildLayout.targets(21,5): error MSB4018: at BuildLayout.Tasks.GenerateArmTemplateTask.Execute() in e:\bt\921388\repo\src\product\buildlayout\Tasks\GenerateArmTemplateTask.cs:line 46 [DeploymentAgent.sfproj] BuildLayout.targets(21,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [DeploymentAgent.sfproj] BuildLayout.targets(21,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [DeploymentAgent.sfproj] BuildLayout.targets(21,5): error MSB4018: [DeploymentAgent.sfproj]
Please help me to understand how it works and why i’m getting it.
@abatishchev commented on Tue Jun 26 2018
Ping.
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (4 by maintainers)
Top GitHub Comments
I think the source of confusing was that AssemblyVersion for all releases in 11.x.x is 11.0.0. Give it a try and please let me know.
I’m seeing the same error when running
dotnet build
from the cli after adding the Mobile.BuildTools package. It has a dependency on Newtonsoft.Json 11.0.2I’m not sure why it’s trying to find
11.0.0.0
since that isn’t what the package is requiring.I’ve added a repro repo If you try and build the project from the cli you’ll see the error.
dotnet --info