sdk: Cannot invoke project dependency command on a library

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

About this issue

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

Most upvoted comments

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)

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