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 build` CLI issue with `-v:n -bl` in .NET 7 RC 1 builds

See original GitHub issue

Describe the bug

Let me begin by saying this is weird. Not sure if it is a dotnet CLI issue or MSBuild.

This started happening here: https://github.com/xamarin/xamarin-android/pull/7217

I found if you do:

$ dotnet build -v:n -bl Xamarin.Android.sln -t:Restore || echo "Exit code: $?"
...
Determining projects to restore...
Exit code: 1

This seems to work fine if I remove the -v:n argument. Such as: https://github.com/xamarin/xamarin-android/pull/7217/commits/17bc8657d0bae5e488637aeda6cee312a53b7034

If I try .NET 7 Preview 6 (just tried latest public build):

Time Elapsed 00:00:02.31

The exit code isn’t printed because it was a success (was 0).

To Reproduce

Install .NET 7.0.100-rc.1.22402.10, and run -t:Restore -bl -v:n on a .sln file? I don’t think there is anything special about our .sln. I also think it might happen for any target? Nothing special about Restore.

Exceptions (if any)

None? .binlog does not have errors either?

Further technical details

.NET SDK:
 Version:   7.0.100-rc.1.22402.10
 Commit:    3faa96e7bf

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  12.4
 OS Platform: Darwin
 RID:         osx.12-arm64
 Base Path:   /Users/jopepper/src/xamarin-android/bin/Debug/dotnet/sdk/7.0.100-rc.1.22402.10/

Host:
  Version:      7.0.0-rc.1.22381.5
  Architecture: arm64
  Commit:       508fef51e8

.NET SDKs installed:
  7.0.100-rc.1.22402.10 [/Users/jopepper/src/xamarin-android/bin/Debug/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.0-rc.1.22401.10 [/Users/jopepper/src/xamarin-android/bin/Debug/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.0-rc.1.22381.5 [/Users/jopepper/src/xamarin-android/bin/Debug/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  x64   [/usr/local/share/dotnet/x64]

Environment variables:
  Not set

global.json file:
  /Users/jopepper/src/xamarin-android/global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rokoneccommented, Aug 4, 2022

@jonathanpeppers That you for great bug report. Thanks to it we have found and fixed yet another elusive bug. We plant to merge it into msbuild tomorrow and it will flow into SDK soon.

1reaction
baronfelcommented, Aug 3, 2022

@rokonec something for the team to check out

Read more comments on GitHub >

github_iconTop Results From Across the Web

Workaround for build issue in .NET CLI 7 rc1 : r/dotnet
In case you run into this build issue with .NET CLI and .NET 7 rc1: Try the following: dotnet build --disable-build-servers dotnet run ......
Read more >
dotnet build command - .NET CLI
The dotnet build command builds a project and all of its dependencies.
Read more >
NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
dotnet run command - .NET CLI
The dotnet run command provides a convenient option to run your application from the source code.
Read more >
dotnet test command - .NET CLI
The dotnet test command builds the solution and runs a test host application for each test project in the solution. The test host...
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