question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet publish / run for linux-arm fails with NetCore5 targets in preview 5+

See original GitHub issue

Describe the bug

Running dotnet publish for a project with target netcore5 fails with the current runtime

Global.json at the time of this writting:

{
  "tools": {
    "dotnet": "5.0.100-preview.5.20251.2",
    "runtimes": {
      "dotnet/x64": [
        "2.1.11"
      ]
    }
  },
  "sdk": {
    "version": "5.0.100-preview.5.20251.2"
  },
  "msbuild-sdks": {
    "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20261.9",
    "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20261.9"
  }
}

Steps to reproduce

On the desktop (Windows) run:

cd projects\iot
build
# passes as expected
cd src\devices\Ads1115\samples
dotnet publish Ads1115.Samples.csproj -r linux-arm -c debug --self-contained false
# passes as well - all fine (the path \src\devices\Ads1115\samples\bin\Debug\netcoreapp2.1\linux-arm\publish now contains binaries ready to run on the pi)

# now change in Ads1115.Samples.csproj the <TargetFramework> entry to <TargetFramework>netcoreapp5.0</TargetFramework>
dotnet publish Ads1115.Samples.csproj -r linux-arm -c debug --self-contained false

An error is now reported:

C:\projects\iot2\src\devices\Ads1115\samples>dotnet publish Ads1115.Samples.csproj -r linux-arm -c debug --self-contained false
Microsoft (R)-Build-Engine, Version 16.7.0-preview-20229-03+2cee6d020 für .NET
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

  Wiederherzustellende Projekte werden ermittelt...
C:\projects\iot2\src\devices\Ads1115\samples\Ads1115.Samples.csproj : error NU1102: Das Paket "Microsoft.NETCore.App.Host.linux-arm" der Version (= 5.0.0-preview.5.20230.9) wurde nicht gefunden.
C:\projects\iot2\src\devices\Ads1115\samples\Ads1115.Samples.csproj : error NU1102:   - 2034 Version(en) gefunden in "https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" [ Nächste Version: 5.0.0-preview.5.20224.13 ]
C:\projects\iot2\src\devices\Ads1115\samples\Ads1115.Samples.csproj : error NU1102:   - 22 Version(en) gefunden in "nuget.org" [ Nächste Version: 5.0.0-preview.4.20251.6 ]
C:\projects\iot2\src\devices\Ads1115\samples\Ads1115.Samples.csproj : error NU1102:   - 0 Version(en) gefunden in https://dotnet.myget.org/F/dotnet-core/api/v3/index.json.
C:\projects\iot2\src\devices\Ads1115\samples\Ads1115.Samples.csproj : error NU1102:   - 0 Version(en) gefunden in https://dotnetfeed.blob.core.windows.net/dotnet-iot/index.json.
C:\projects\iot2\src\devices\Ads1115\samples\Ads1115.Samples.csproj : error NU1102:   - 0 Version(en) gefunden in https://dotnetfeed.blob.core.windows.net/dotnet-tools-internal/index.json.
  Fehler beim Wiederherstellen von "C:\projects\iot2\src\devices\Ads1115\samples\Ads1115.Samples.csproj" (in "1.11 sec").
  2 von 3 Projekten sind für die Wiederherstellung auf dem neuesten Stand.

Expected behavior

Build passes

Actual behavior

See above. It looks a bit as if the SDK build that’s currently referenced is incomplete. The problem does not happen if going back to the “official” beta version 5.0.100-preview.4.20258.7

Versions used SDK: 5.0.100-preview.5.20251.2 [C:\Program Files\dotnet\sdk] Runtime: Microsoft.NETCore.App 5.0.0-preview.5.20230.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Edit See below: The problem got even worse with previews 6 and 7. I can’t get them to work at all on the Raspi when targetting NetCore 5.0.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:25 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
joperezrcommented, Sep 19, 2020

Sure, I have the changes ready since they are very simple but we are currently blocked on commiting them( check #1091 for more info). Basically the change we need to do is to removed the winmd references from the project as well as the dependency to package System.Runtime.WindowsRuntime, and instead add a package dependency to Microsoft.Windows.SDK.NET. That’s it, that should make it work, except that we can’t make that change yet as there is a bug on that SDK package because it has assemblies that are not strong-named signed, and because our assembly is then we won’t be able to compile. I have pinged the team that manages that package so they are aware we are broken and will work on fixing it so that we are unblocked.

0reactions
joperezrcommented, Oct 22, 2020

Forgot to close this one too but it was also fixed by https://github.com/dotnet/iot/pull/1217

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet publish command - .NET CLI
The dotnet publish command calls MSBuild, which invokes the Publish target. If the IsPublishable property is set to false for a particular ...
Read more >
Ask Question
On "Hosted VS2017" and self-hosted build agent (Windows Server 2012 R2), running dotnet publish with a publish profile specified fails with: C:\ ...
Read more >
NETSDK1045: The current .NET SDK does not support ...
The full error message is similar to the following example: NETSDK1045: The current .NET SDK does not support 'newer version' as a target....
Read more >
Unable to publish using target framework netcore3.1 and ...
When I try to publish it to a folder, using target runtime win-x64 ... can go to the command line and run “dotnet...
Read more >
Pack Failed: error NETSDK1194: Issue running dotnet publish ...
Fix 1: Use an older SDK version. The simplest fix would be to use an older SDK version: · Fix 2: Use --output...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found