-
Notifications
You must be signed in to change notification settings - Fork 29
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
RE: override property for the msbuildversion. #56
Comments
Hi James, Thx |
Francois,
First, thanks for looking at this.
From what I can tell, inferring output in a debug log, that both nuget pack and restore<https://docs.microsoft.com/en-us/nuget/tools/cli-ref-restore> use msbuild (perhaps to obtain property values from Visual Studio metadata files?).
++ LOG OUTPUT BELOW ++
...
09:59:05.007 [QUIET] [system.out] NuGet Version: 4.3.0.4
09:59:05.008 [QUIET] [system.out] Restoring NuGet packages for solution C:\Users\japoli\WinCDP\CDPINT-3551\ConsoleApplication\ConsoleApplication.sln.
09:59:05.068 [QUIET] [system.out] MSBuild auto-detection: using msbuild version '15.1.1012.6693' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
Both commands have a msbuildversion option otherwise nuget will use its own algorithm to determine the which one to use (latest installed).
I'm running into a problem when I run the nuget plugin for a restore where nuget chooses an incorrect version of msbuild (15.0) for my project which used msbuild version
12.0 in Visual Studio when I created it. FWIW, I have several versions of Visual Studio installed on my machine.
++ LOG OUTPUT BELOW ++
...
09:59:05.206 [QUIET] [system.out] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\msbuild.exe /t:GenerateRestoreGraphFile /nologo /nr:false /p:RestoreUseCustomAfterTargets=true /p:BuildProjectReferences=false /v:q /p:NuGetRestoreTargets="C:\Users\japoli\AppData\Local\Temp\NuGet-Scratch\wexslzjz.d0q.targets" /p:RestoreTaskAssemblyFile="C:\NuGet\NuGet.exe" /p:RestoreGraphOutputPath="C:\Users\japoli\AppData\Local\Temp\NuGet-Scratch\ut1rhbt3.a0k.result" /p:ExcludeRestorePackageImports=true /p:RestoreSolutionDirectory="C:\Users\japoli\WinCDP\CDPINT-3551\ConsoleApplication" /p:RestoreRecursive=False /p:RestoreProjectFilterMode=exclusionlist /p:RestoreContinueOnError=WarnAndContinue /p:RestoreGraphProjectInput="C:\Users\japoli\WinCDP\CDPINT-3551\ConsoleApplication\ConsoleApplication\ConsoleApplication.vcxproj;" "C:\Users\japoli\AppData\Local\Temp\NuGet-Scratch\wexslzjz.d0q.targets"
09:59:05.452 [QUIET] [system.out] NuGet.CommandLine.ExitCodeException: Exception of type 'NuGet.CommandLine.ExitCodeException' was thrown.
I do use the gradle-msbuild plugin, perhaps the nuget exec for restore/pack could use it’s default value as part of the msbuildversion option?
Thanks, Jim
From: Francois Valdy [mailto:[email protected]]
Sent: Tuesday, November 07, 2017 5:33 AM
To: Ullink/gradle-nuget-plugin <[email protected]>
Cc: James Poli <[email protected]>; Author <[email protected]>
Subject: Re: [Ullink/gradle-nuget-plugin] RE: override property for the msbuildversion. (#56)
EXTERNAL
Hi James,
What do you mean by that ?
NugetPack<https://github.com/Ullink/gradle-nuget-plugin/blob/master/src/main/groovy/com/ullink/NuGetPack.groovy> doesn't make use or rely on Msbuild (but if gradle-msbuild plugin is applied and used, it gets its default values from the gradle-msbuild setup)
Thx
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#56 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AFbDPse8wowsJPyzXrC1xnCzNCeEuAIuks5s0DHIgaJpZM4QTK8P>.
|
Your proposal sounds about right, we could add the MSBuildVersion param (to all nuget tasks or only some of them ?), and add a default mapping to the one used by gradle-msbuild. Interested in picking up the task ? I myself have never had the need for this param, and the only related link I found doesn't make it clear what value this parameter takes. Thx. |
Sure, I'll try to implement the task; that way I can test it. I'll review the command's again but I believe only the pack and restore support the msbuildversion. Ah, I found that update also supports the option. |
Francois, |
The task graph shouldn't matter, if Note that if it wasn't set explicitely in the gradle build, then it'll resolve to the latest when executing the msbuild task, in that case you can't get the version used, but you shouldn't need to (if msbuild is set to using the latest, nuget should do the same, meaning the version shouldn't be set explicitly). Feel free to push your changes as a PR even if not finished yet, we can discuss on that. |
Looking closer at our code, we set the version at runtime prior to the msbuild task running which matches your explanation, thanks. I'll go ahead and add back in the code that uses the msbuild version if it's set. I've got some more testing to do, then I'll push. How do you want me to push? In a separate branch or in a fork? |
Sorry, Francois, it's taking a while, the code is complete; I'm just waiting for legal approval from SAS to commit it. Should be approved this week. Jim |
Ok Francois, created PR. Jim |
What's the process to get this released? |
released in 2.16 |
Hello,
We need an override property for the msbuildversion on the Nuget pack and restore. Any possibility of getting it added?
Thanks,
Jim
The text was updated successfully, but these errors were encountered: