Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuget restore doesn't work with msbuild 16 on mono #9222

Open
helviett opened this issue Feb 26, 2020 · 15 comments
Open

Nuget restore doesn't work with msbuild 16 on mono #9222

helviett opened this issue Feb 26, 2020 · 15 comments
Labels
Category:Quality Week Issues that should be considered for quality week Platform:Mono NuGet.exe on mono scenarios Priority:2 Issues for the current backlog. Product:NuGet.exe NuGet.exe Type:Bug

Comments

@helviett
Copy link

Details about Problem

On MacOS nuget.exe version 5.4, 5.3.1, 5.2 etc.

mono nuget.exe restore -MSBuildPath /path/to/msbuild16v or /path/to/vstool/that/use/msbuild16. Using nuget without mono provides the same result.

Works with msbuild 15 or 14.

Verbose Logs

nuget restore Launcher.Mac.sln -MSBuildPath "/Library/Frameworks/Mono.framework/Versions/Current/Commands" -Verbosity detailed

Using Msbuild from '/Library/Frameworks/Mono.framework/Versions/Current/Commands'.
NuGet Version: 5.2.0.6090
Error parsing solution file at /Users/gameforest/dev/Citrus/Orange/Launcher/Launcher.Mac.sln: Invalid Image
NuGet.CommandLine.CommandLineException: Error parsing solution file at /Users/gameforest/dev/Citrus/Orange/Launcher/Launcher.Mac.sln: Invalid Image
  at NuGet.CommandLine.MsBuildUtility.GetAllProjectFileNamesWithMsBuild (System.String solutionFile, System.String msbuildPath) [0x000a1] in <86071b8d89ed441c8bd0686989227b79>:0
  at NuGet.CommandLine.MsBuildUtility.GetAllProjectFileNames (System.String solutionFile, System.String msbuildPath) [0x00021] in <86071b8d89ed441c8bd0686989227b79>:0
  at NuGet.CommandLine.RestoreCommand.ProcessSolutionFile (System.String solutionFileFullPath, NuGet.CommandLine.RestoreCommand+PackageRestoreInputs restoreInputs) [0x00056] in <86071b8d89ed441c8bd0686989227b79>:0
  at NuGet.CommandLine.RestoreCommand.GetInputsFromFile (System.String projectFilePath, NuGet.CommandLine.RestoreCommand+PackageRestoreInputs packageRestoreInputs) [0x00072] in <86071b8d89ed441c8bd0686989227b79>:0
  at NuGet.CommandLine.RestoreCommand.DetermineRestoreInputsAsync () [0x00080] in <86071b8d89ed441c8bd0686989227b79>:0
  at NuGet.CommandLine.RestoreCommand.ExecuteCommandAsync () [0x000be] in <86071b8d89ed441c8bd0686989227b79>:0
  at NuGet.CommandLine.Command.Execute () [0x000ea] in <86071b8d89ed441c8bd0686989227b79>:0
  at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, System.String[] args) [0x001c1] in <86071b8d89ed441c8bd0686989227b79>:0

System details

=== Visual Studio Community 2019 for Mac ===

Version 8.3.10 (build 2)
Installation UUID: 7bd83e47-a735-4ff0-89ea-d6d6c4bb5bfe
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.16.1.24 (d16-3 / 08809f5b)

Package version: 604000208

=== Mono Framework MDK ===

Runtime:
Mono 6.4.0.208 (2019-06/07c23f2ca43) (64-bit)
Package version: 604000208

=== NuGet ===

Version: 5.3.0.6192

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.0.100/Sdks
SDK Versions:
3.0.100
2.1.700
2.1.505
2.1.504
2.1.302
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.0.0
2.1.13
2.1.11
2.1.9
2.1.8
2.1.2

=== Xamarin.Profiler ===

Version: 1.6.12.29
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 11.2 (15526)
Build 11B52

=== Xamarin.Mac ===

Version: 6.6.0.12 (Visual Studio Community)
Hash: e3c2b406d
Branch: xcode11.2
Build date: 2019-11-01 00:12:07-0400

=== Xamarin.iOS ===

Version: 13.6.0.12 (Visual Studio Community)
Hash: e3c2b406d
Branch: xcode11.2
Build date: 2019-11-01 00:12:08-0400

=== Xamarin.Android ===

Version: 10.0.6.2 (Visual Studio Community)
Commit: xamarin-android/d16-3/c407838
Android SDK: /Users/gameforest/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
4.4 (API level 19)
4.4.87 (API level 20)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 27.0.1
SDK Build Tools Version: 27.0.3

Build Information:
Mono: mono/mono@476d72b9e32
Java.Interop: xamarin/java.interop/d16-3@5836f58
LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94
LibZip: nih-at/libzip@b95cf3fd
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/gameforest/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 1.4.0.65
Hash: c33b107
Branch: remotes/origin/d16-3
Build date: 2019-11-19 20:33:22 UTC

=== Android Device Manager ===

Version: 1.2.0.116
Hash: d2b2af0
Branch: remotes/origin/d16-3
Build date: 2019-11-19 20:33:42 UTC

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Xamarin Designer ===

Version: 16.3.0.256
Hash: 8a223bfd7
Branch: remotes/origin/d16-3
Build date: 2019-11-01 21:02:02 UTC

=== Build Information ===

Release ID: 803100002
Git revision: add3a4998a5cb5b081e0404e1fe13acfecb7801d
Build date: 2019-11-20 13:35:15+00
Build branch: release-8.3
Xamarin extensions: 79c69708816813b498283eeda7bcb4d464433a04

=== Operating System ===

Mac OS X 10.14.5
Darwin 18.6.0 Darwin Kernel Version 18.6.0
Thu Apr 25 23:16:27 PDT 2019
root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64

@nkolev92 nkolev92 added Product:NuGet.exe NuGet.exe Platform:Mono NuGet.exe on mono scenarios WaitingForCustomer Applied when a NuGet triage person needs more info from the OP labels Mar 3, 2020
@nkolev92
Copy link
Member

nkolev92 commented Mar 3, 2020

Hey @KeltarHelviett
Does any version of NuGet.exe work with msbuild 16 on mono?

@nkolev92 nkolev92 changed the title Nuget restore doesn't work with msbuild 16 Nuget restore doesn't work with msbuild 16 on mono Mar 3, 2020
@helviett
Copy link
Author

helviett commented Mar 5, 2020

Hey @KeltarHelviett
Does any version of NuGet.exe work with msbuild 16 on mono?

We have tried several versions (5.x, 3.x). None of them worked with msbuild 16 on mono.

@helviett
Copy link
Author

@nkolev92 Are there any changes?

@nkolev92
Copy link
Member

cc @rrelyea

@helviett
Copy link
Author

helviett commented Apr 7, 2020

@nkolev92 A month has passed. Are there any changes?

@nkolev92
Copy link
Member

nkolev92 commented Jul 2, 2020

Hey @KeltarHelviett

We are prioritizing issues that have high customer impact and we haven't seen too many reports of this problem.

Have you considered using dotnet.exe, as it's the preferred way for managing your .NET Core projects on Linux & Mac.

@nkolev92 nkolev92 added the Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. label Jul 2, 2020
@kartheekp-ms
Copy link
Contributor

Have you considered using dotnet.exe, as it's the preferred way for managing your .NET Core projects on Linux & Mac.

@KeltarHelviett - Please let us know your feedback regarding above suggestion to consider using dotnet.exe

@helviett
Copy link
Author

Have you considered using dotnet.exe, as it's the preferred way for managing your .NET Core projects on Linux & Mac.

@KeltarHelviett - Please let us know your feedback regarding above suggestion to consider using dotnet.exe

We're using Xamarin.Mac 2.0.

@erdembayar erdembayar removed the WaitingForCustomer Applied when a NuGet triage person needs more info from the OP label Mar 10, 2021
@erdembayar
Copy link
Contributor

Have you considered using dotnet.exe, as it's the preferred way for managing your .NET Core projects on Linux & Mac.

@KeltarHelviett - Please let us know your feedback regarding above suggestion to consider using dotnet.exe

We're using Xamarin.Mac 2.0.

We're asking have you tried something like dotnet restore or dotnet restore Yourpath\YourApp.csproj ?
Please let us know.

@erdembayar erdembayar added the WaitingForCustomer Applied when a NuGet triage person needs more info from the OP label Mar 10, 2021
@helviett
Copy link
Author

dotnet restore doesn't work with Xamarin.Mac project.

@erdembayar erdembayar removed the WaitingForCustomer Applied when a NuGet triage person needs more info from the OP label Mar 10, 2021
@aortiz-msft
Copy link
Contributor

@v-luzh - Would you please repro this on Mac using our latest bits?

@v-luzh
Copy link

v-luzh commented Mar 23, 2021

@aortiz-msft It repro with msbuild 16 on mono. Not repro on default msbuild V15. Please refer to the discussion mail with Heng.

@v-luzh v-luzh removed their assignment Mar 23, 2021
@aortiz-msft aortiz-msft removed Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Triage:Investigate labels Mar 24, 2021
@aortiz-msft aortiz-msft added Priority:2 Issues for the current backlog. Category:Quality Week Issues that should be considered for quality week labels Mar 24, 2021
@aortiz-msft aortiz-msft added this to the Sprint 2021-04 milestone Mar 24, 2021
@softlion
Copy link

softlion commented Nov 3, 2021

The issue is easy: the version of msbuild is hard coded to 14 and 15 for mono in NuGet.CommandLine MsBuildUtility.cs method GetMsBuildFromMonoPaths()

https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.CommandLine/MsBuildUtility.cs

And this nuget client has no env variable it could take instead to force the use of a more up-to-date version of msbuild.

An easy fix would be to read an env variable instead that would give the path of msbuild.

@nkolev92 nkolev92 assigned nkolev92 and heng-liu and unassigned nkolev92 Nov 4, 2021
@mos379
Copy link

mos379 commented Feb 2, 2022

any update here?

@omatrot
Copy link

omatrot commented Oct 28, 2022

Have you considered using dotnet.exe, as it's the preferred way for managing your .NET Core projects on Linux & Mac.

@KeltarHelviett - Please let us know your feedback regarding above suggestion to consider using dotnet.exe

@kartheekp-ms Using dotnet restore will work, but later on MSBuild will fail as per @softlion comment about hardcoded paths in the source code. This is incredible that is issue is not resolved yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Quality Week Issues that should be considered for quality week Platform:Mono NuGet.exe on mono scenarios Priority:2 Issues for the current backlog. Product:NuGet.exe NuGet.exe Type:Bug
Projects
None yet
Development

No branches or pull requests

10 participants