dnx
dnx copied to clipboard
'dnu install <package-name>' throws error in some scenarios
From within the project directory: Does not work:
dnu install Microsoft.AspNet.Diagnostics.Elmdnu install Microsoft.AspNet.Diagnostics.Elm 1.0.0-beta5
Works:
dnu install Microsoft.AspNet.Diagnostics.Elm 1.0.0-beta5 .(notice the.)
Following is the help info for dnu help install:
C:\Users\kichalla\Desktop\TestAppPackaging\src\TestAppPackaging [master +0 ~1 -0]> dnu help install
Microsoft .NET Development Utility CLR-x86-1.0.0-beta5-12087
Usage: dnu install [arguments] [options]
Arguments:
[name] Name of the dependency to add
[version] Version of the dependency to add, default is the latest version.
[project] Path to project, default is current directory
Instead of mentioning project path in the end of the arguments list, I would prefer it as the first argument so that I am not forced to supply the version number of the nuget package and just get the latest package.
Error:
C:\\TestAppPackaging\src\TestAppPackaging [master]> dnu install Microsoft.AspNet.Diagnostics.Elm
Microsoft .NET Development Utility CLR-x86-1.0.0-beta5-12087
CACHE https://www.nuget.org/api/v2/
CACHE https://www.myget.org/F/aspnetbeta5/api/v2/
CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.AspNet.Diagnostics.Elm'
CACHE https://www.myget.org/F/aspnetbeta5/api/v2/FindPackagesById()?id='Microsoft.AspNet.Diagnostics.Elm'
Microsoft.AspNet.Diagnostics.Elm.1.0.0-beta5 was added to project.json.
System.ArgumentNullException: Value cannot be null.
Parameter name: path
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.Path.GetFullPath(String path)
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Linq.Enumerable.<DistinctIterator>d__1`1.MoveNext()
at Microsoft.Framework.PackageManager.RestoreCommand.<Execute>d__75.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Framework.PackageManager.InstallCommand.<ExecuteCommand>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Framework.PackageManager.InstallConsoleCommand.<>c__DisplayClass0_0.<<Register>b__1>d.MoveNext()
I've noticed the same thing; I think if you run dnu install Microsoft.AspNet.Diagnostics.Elm, you'll notice that the install process managed to modify project.json before crashing. That means running dnu restore immediately after that will finish the job successfully. So at least there's a quick-ish workaround in the meantime.