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 can't find `msbuild.exe` on Mono? #3085

Closed
ethomson opened this Issue Jul 6, 2016 · 18 comments

Comments

Projects
None yet
@ethomson

ethomson commented Jul 6, 2016

https://github.com/libgit2/LibGit2Sharp is trying to get fancy with the new .NET Core. It seems like things are working with the Nuget 3.5.0 beta on Windows with the proper .NET CLR. However, nuget restore is not working for us on Mono:

% mono Lib/NuGet/Nuget.exe restore
MSBuild auto-detection: using msbuild version '4.0' from '/Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/4.5'.
MsBuild.exe does not exist at '/Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/4.5/msbuild.exe'.

There is, of course, no msbuild.exe on Mono. :(

Not sure if this is not supported at all (in which case a more helpful error message would be nice) or if this should actually be looking for xbuild.exe in the same location on Mono.

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Jul 6, 2016

Contributor

Are you using 3.5.0-beta2 of NuGet.exe?
Which build of NuGet.exe last ran properly for you on Mono?
What project are you trying restore? LibGit2Sharp?

Contributor

rrelyea commented Jul 6, 2016

Are you using 3.5.0-beta2 of NuGet.exe?
Which build of NuGet.exe last ran properly for you on Mono?
What project are you trying restore? LibGit2Sharp?

@ethomson

This comment has been minimized.

Show comment
Hide comment
@ethomson

ethomson Jul 7, 2016

Are you using 3.5.0-beta2 of NuGet.exe?

Yes:

% mono Lib/NuGet/NuGet.exe help
NuGet Version: 3.5.0.1520

Which build of NuGet.exe last ran properly for you on Mono?

AFAIK, this has never worked with our new .NET Core compatible project structure. We are (successfully) building the old-style project structure using NuGet Version: 2.8.60318.667.

What project are you trying restore? LibGit2Sharp?

Yes - we're trying to run package restore to build LibGit2Sharp.

ethomson commented Jul 7, 2016

Are you using 3.5.0-beta2 of NuGet.exe?

Yes:

% mono Lib/NuGet/NuGet.exe help
NuGet Version: 3.5.0.1520

Which build of NuGet.exe last ran properly for you on Mono?

AFAIK, this has never worked with our new .NET Core compatible project structure. We are (successfully) building the old-style project structure using NuGet Version: 2.8.60318.667.

What project are you trying restore? LibGit2Sharp?

Yes - we're trying to run package restore to build LibGit2Sharp.

odinserj added a commit to HangfireIO/Hangfire that referenced this issue Jul 18, 2016

@GreatMichalT

This comment has been minimized.

Show comment
Hide comment
@GreatMichalT

GreatMichalT Jul 20, 2016

Hi! I have the same problem on version 3.4.4.1321. I want use it with Bamboo on OS X, is other way to restore packages? Or is some beta version with fixed this bug?

GreatMichalT commented Jul 20, 2016

Hi! I have the same problem on version 3.4.4.1321. I want use it with Bamboo on OS X, is other way to restore packages? Or is some beta version with fixed this bug?

@radical

This comment has been minimized.

Show comment
Hide comment
@radical

radical Jul 20, 2016

@ethomson Mono has added a shell script called msbuild which executes the open sourced msbuild and not xbuild.exe. It runs that from /Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/msbuild/14.1/bin/MSBuild.exe .

radical commented Jul 20, 2016

@ethomson Mono has added a shell script called msbuild which executes the open sourced msbuild and not xbuild.exe. It runs that from /Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/msbuild/14.1/bin/MSBuild.exe .

@ethomson

This comment has been minimized.

Show comment
Hide comment
@ethomson

ethomson Jul 20, 2016

@radical That does not help me, though, unless I can inform nuget of this location.

ethomson commented Jul 20, 2016

@radical That does not help me, though, unless I can inform nuget of this location.

@radical

This comment has been minimized.

Show comment
Hide comment
@radical

radical Jul 20, 2016

Maybe this commit broke it? It changes the logic to look for msbuild.exe specifically now. On Mono, it can should try to use xbuild, that will be available in $PATH. Or if they wanted to use the preview msbuild on Mono, then look for msbuild in $PATH.

radical commented Jul 20, 2016

Maybe this commit broke it? It changes the logic to look for msbuild.exe specifically now. On Mono, it can should try to use xbuild, that will be available in $PATH. Or if they wanted to use the preview msbuild on Mono, then look for msbuild in $PATH.

@kpranavk

This comment has been minimized.

Show comment
Hide comment
@kpranavk

kpranavk Jul 25, 2016

What's the latest on this thread. I am hitting the exact same error. If that commit broke it, what is the suggestion you are making? Is msbuild or xbuild the right thing to use. I am on Xamarin.iOS

kpranavk commented Jul 25, 2016

What's the latest on this thread. I am hitting the exact same error. If that commit broke it, what is the suggestion you are making? Is msbuild or xbuild the right thing to use. I am on Xamarin.iOS

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Aug 16, 2016

Can you try passing -msbuildversion flag (that avoids the detection phase)

yishaigalatzer commented Aug 16, 2016

Can you try passing -msbuildversion flag (that avoids the detection phase)

@pjcollins

This comment has been minimized.

Show comment
Hide comment
@pjcollins

pjcollins Aug 16, 2016

When running with mono, 4 appears to be the only recognized msbuild version. This failure still manifests in the same way mentioned above when also passing -msbuildversion 4.

pjcollins commented Aug 16, 2016

When running with mono, 4 appears to be the only recognized msbuild version. This failure still manifests in the same way mentioned above when also passing -msbuildversion 4.

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Aug 16, 2016

@pjcollins thanks. We will take a look and find a way around this,

@ethomson any reason you are not using dotnet restore?

yishaigalatzer commented Aug 16, 2016

@pjcollins thanks. We will take a look and find a way around this,

@ethomson any reason you are not using dotnet restore?

@ravensorb

This comment has been minimized.

Show comment
Hide comment
@ravensorb

ravensorb Sep 1, 2016

Any update on this? Maybe a build eta?

ravensorb commented Sep 1, 2016

Any update on this? Maybe a build eta?

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Sep 9, 2016

We don't have an update on this at the moment, we never planned to support .net core builds on mono with nuget.exe.

We will however look at:

  1. Can we run msbuild for restoring a solution on mono for packages.config scenarios (3.5 +)
  2. Can we nuget.exe restore for a solution for the final .net core mode. (3.6 +)

At this point in time if you want to build .net core on linux use dotnet restore.

yishaigalatzer commented Sep 9, 2016

We don't have an update on this at the moment, we never planned to support .net core builds on mono with nuget.exe.

We will however look at:

  1. Can we run msbuild for restoring a solution on mono for packages.config scenarios (3.5 +)
  2. Can we nuget.exe restore for a solution for the final .net core mode. (3.6 +)

At this point in time if you want to build .net core on linux use dotnet restore.

@jtattermusch

This comment has been minimized.

Show comment
Hide comment
@jtattermusch

jtattermusch Sep 13, 2016

@yishaigalatzer, is this the issue to track for "1. Can we run msbuild for restoring a solution on mono for packages.config scenarios (3.5 +)". Is there an ETA for the 3.5 release?
For our project (gRPC) this is important because the user experience is really bad when developers cannot run nuget restore for our solutions on mono. We are in a weird state where one needs at least nuget 2.12, but that one is not officially supported and nuget 3.4 is broken.

jtattermusch commented Sep 13, 2016

@yishaigalatzer, is this the issue to track for "1. Can we run msbuild for restoring a solution on mono for packages.config scenarios (3.5 +)". Is there an ETA for the 3.5 release?
For our project (gRPC) this is important because the user experience is really bad when developers cannot run nuget restore for our solutions on mono. We are in a weird state where one needs at least nuget 2.12, but that one is not officially supported and nuget 3.4 is broken.

@ravensorb

This comment has been minimized.

Show comment
Hide comment
@ravensorb

ravensorb Sep 13, 2016

I agree - I to have several frameworks that can be compiled on mono and are still using package.config - there needs to be a way to restore those packages in an easier manner then restoring to a very old version of nuget :)

ravensorb commented Sep 13, 2016

I agree - I to have several frameworks that can be compiled on mono and are still using package.config - there needs to be a way to restore those packages in an easier manner then restoring to a very old version of nuget :)

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Sep 13, 2016

Yes, we are looking at a fix for this right now. The range at the moment is within weeks for an official release. The mono team did release their own version of 2.12 (though we do not support it), does that unblocks you?

yishaigalatzer commented Sep 13, 2016

Yes, we are looking at a fix for this right now. The range at the moment is within weeks for an official release. The mono team did release their own version of 2.12 (though we do not support it), does that unblocks you?

@akamud

This comment has been minimized.

Show comment
Hide comment
@akamud

akamud Sep 14, 2016

Is there a workaround for this issue while we don't get an official release?

akamud commented Sep 14, 2016

Is there a workaround for this issue while we don't get an official release?

@zhili1208

This comment has been minimized.

Show comment
Hide comment
@zhili1208

zhili1208 Sep 14, 2016

Contributor

@akamud I don't think there is a workaround for this, the issue is NuGet hardcode "msbuild.exe" in code,
I made a fix to fallback to xbuild when msbuild doesn't exist, the fix will be in 3.5-rtm release

Contributor

zhili1208 commented Sep 14, 2016

@akamud I don't think there is a workaround for this, the issue is NuGet hardcode "msbuild.exe" in code,
I made a fix to fallback to xbuild when msbuild doesn't exist, the fix will be in 3.5-rtm release

@zhili1208

This comment has been minimized.

Show comment
Hide comment
Contributor

zhili1208 commented Sep 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment