Regression: self-contained publish fails on Linux ARM in 3.0 Preview 7
See original GitHub issueSteps to reproduce
dotnet new web --framework netcoreapp3.0
dotnet publish -r linux-arm -c Release -o out
Expected behavior
Publish succeeds
Actual behavior
An exception occurs: System.ArgumentException: Can not add property libclrjit.so to Newtonsoft.Json.Linq.JObject. Property with the same name already exists on object.
Microsoft (R) Build Engine version 16.3.0-preview-19329-01+d31fdbf01 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 68.02 ms for /app/app.csproj.
You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: The "GenerateDepsFile" task failed unexpectedly. [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: System.ArgumentException: Can not add property libclrjit.so to Newtonsoft.Json.Linq.JObject. Property with the same name already exists on object. [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Newtonsoft.Json.Linq.JObject.ValidateToken(JToken o, JToken existing) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Newtonsoft.Json.Linq.JContainer.InsertItem(Int32 index, JToken item, Boolean skipParentCheck) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Newtonsoft.Json.Linq.JObject.InsertItem(Int32 index, JToken item, Boolean skipParentCheck) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Newtonsoft.Json.Linq.JContainer.AddInternal(Int32 index, Object content, Boolean skipParentCheck) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Newtonsoft.Json.Linq.JContainer.Add(Object content) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Microsoft.Extensions.DependencyModel.DependencyContextWriter.WriteAssetList(IEnumerable`1 runtimeFiles) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Microsoft.Extensions.DependencyModel.DependencyContextWriter.AddAssets(JObject libraryObject, String key, RuntimeAssetGroup group) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Microsoft.Extensions.DependencyModel.DependencyContextWriter.WriteTargetLibrary(Library library) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Microsoft.Extensions.DependencyModel.DependencyContextWriter.<WriteTarget>b__7_0(Library library) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext() [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Newtonsoft.Json.Linq.JContainer.AddInternal(Int32 index, Object content, Boolean skipParentCheck) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Newtonsoft.Json.Linq.JContainer.Add(Object content) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Newtonsoft.Json.Linq.JObject..ctor(Object content) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Microsoft.Extensions.DependencyModel.DependencyContextWriter.WriteTarget(IReadOnlyList`1 libraries) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Microsoft.Extensions.DependencyModel.DependencyContextWriter.WriteTargets(DependencyContext context) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Microsoft.Extensions.DependencyModel.DependencyContextWriter.Write(DependencyContext context) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Microsoft.Extensions.DependencyModel.DependencyContextWriter.Write(DependencyContext context, Stream stream) [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Microsoft.NET.Build.Tasks.GenerateDepsFile.WriteDepsFile(String depsFilePath) in /_/src/Tasks/Microsoft.NET.Build.Tasks/GenerateDepsFile.cs:line 173 [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Microsoft.NET.Build.Tasks.GenerateDepsFile.ExecuteCore() in /_/src/Tasks/Microsoft.NET.Build.Tasks/GenerateDepsFile.cs:line 190 [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() in /_/src/Tasks/Common/TaskBase.cs:line 38 [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Microsoft.NET.Build.Tasks.GenerateDepsFile.Execute() in /_/src/Tasks/Microsoft.NET.Build.Tasks/GenerateDepsFile.cs:line 182 [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/app/app.csproj]
/usr/share/dotnet/sdk/3.0.100-preview7-012769/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(168,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/app/app.csproj]
The command '/bin/sh -c dotnet publish -r $rid -c Release -o out' returned a non-zero code: 1
Environment data
This issue was discovered in our CI validation tests for .NET Docker when running the test scenario on Linux ARM hardware.
This is a regression and was introduced between the following two SDK versions: 3.0.100-preview7-012743 and 3.0.100-preview7-012769.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
dotnet publish get SSL error in WSL1 - Developer Community
I install the fresh new Ubuntu 20.04 from Microsoft store and install .Net 5.0 follow the instruction on dotnet documentation. https://docs.microsoft.com/zh-cn/ ...
Read more >dotnet publish command - .NET CLI
dotnet publish - Publishes the application and its dependencies to a folder for deployment to a hosting system.
Read more >error NETSDK1031: It is not supported to build or publish a ...
I am running following command to publish .NET CORE 5.0 web api project using command line on windows 10 box. c:\test\Service>dotnet publish -c ......
Read more >Self-contained executable with .NET Core 3.0 on Windows ...
This blog post demonstrates how to build self-contained executable using .NET Core 3.0. NB! As of writing this post the current version of...
Read more >CRAN Packages By Date
2023-08-21, RobustAFT, Truncated Maximum Likelihood Fit and Robust Accelerated Failure Time Regression for Gaussian and Log-Weibull Case.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The runtime list is supposed to be the list of files that will be included for self-contained apps. So it should not include the x64_arm file in this case.
I think the SDK should fail more gracefully here, but I don’t think it should try to choose the best file to use in a case like this.
I merged https://github.com/dotnet/core-setup/pull/7042 into Core-Setup
release/3.0
to fix this for preview 7. (FYI for those on this thread.)