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.

Cannot invoke project dependency command on a library

See original GitHub issue

Update: the error is only on libraries, not standalone.

It looks like https://github.com/dotnet/cli/pull/2617 broke PackagedCommandSpecFactory in tools on standalone apps.

Steps to reproduce

Create a tool that invokes tries to execute a dependency command where projectContext is a netstandard library.

                new ProjectDependenciesCommandFactory(
                        projectContext.TargetFramework,
                        Constants.DefaultConfiguration,
                        null,
                        null,
                        projectContext.ProjectDirectory
                    )
                    .Create("dotnet-my-tool", 
                            new []{"--dispatch", "--verbose"}, 
                            projectContext.TargetFramework, 
                            Constants.DefaultConfiguration)

Repro project: https://github.com/natemcmaster/dotnet-sample-tool/tree/issue2645.

Expected behavior

ProjectDependenciesCommandFactory should create and execute a command on the netstandard library.

Actual behavior

On a library project

Running C:\Users\namc\dev\dotnet-sample-tool\.dotnet\shared\Microsoft.NETCore.App\1.0.0-rc2-3002476\corehost.exe --runtimeconfig C:\Users\namc\dev\dotnet-sample-tool\SampleLibrary\bin\Debug\netstandard1.5\SampleLibrary.runtimeconfig.json --depsfile C:\Users\namc\dev\dotnet-sample-tool\SampleLibrary\bin\Debug\netstandard1.5\SampleLibrary.deps.json --additionalprobingpath C:\Users\namc\.nuget\packages C:\Users\namc\.nuget\packages\dotnet-my-tool\1.0.0-tmp1461321718.66929\lib\netstandard1.5\dotnet-my-tool.dll --dispatch --verbose
Process ID: 55528
Could not resolve coreclr path

Environment data

Microsoft.DotNet.Cli.Utils/1.0.0-rc2-002476

dotnet --info output:

.NET Command Line Tools (1.0.0-rc2-002476)

Product Information:
 Version:     1.0.0-rc2-002476
 Commit Sha:  1a8d393b9b

Fails on windows and linux.

Trace: corehost_trace.log.txt

cc @schellap @piotrpMSFT

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:18 (13 by maintainers)

github_iconTop GitHub Comments

27reactions
kierenjcommented, Aug 20, 2016

Glad I found this issue here, very useful. Sorry for the annoying question, but is there a ballpark ETA on this one - just so I can make some plans this end? (An order of magnitude is good enough for me! - 1d/1w/1m/1q/1y)

10reactions
natemcmastercommented, May 20, 2016

Has there been any progress on this? There has been a lot of chatter about this limitation, especially because the workarounds are not easy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot invoke project dependency command on a library
Create a tool that invokes tries to execute a dependency command where projectContext is a netstandard library. ... Repro project: https://github.
Read more >
Cannot invoke method get() on null object
I'm experiencing a build issue when adding a firebase dependency to a android library. My setup is as follows. /settings.gradle
Read more >
Failed to notify action. Cannot invoke method containers ...
I just upgraded to gradle-rc1 and wanted to see if my projects still build, and immediately I get a failure "Failed to notify...
Read more >
Declaring dependencies
Every dependency declared for a Gradle project applies to a specific scope. For example some dependencies should be used for compiling source code...
Read more >
Add build dependencies | Android Studio
Learn how to add build dependencies using the Gradle build system in Android Studio.
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