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.

Unable to include project reference to CLI tool

See original GitHub issue

Steps to reproduce

Create two .NET Core projects

  • Class library representing the tool (DemoTool) – Add Program.cs with Main(string[] args) => Console.WriteLine("Hello World");
{
  "title": "Demo Tool",
  "version": "0.1.0-*",

  "buildOptions": {
    "emitEntryPoint": true,
    "outputName": "dotnet-demo-tool"
  },

  "dependencies": {
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": "portable-net452+win81",
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.0.0-rc2-3002702",
          "type": "platform"
        }
      }
    }
  }
}
  • Console application representing the app (DemoApp) referencing the tool

Configure a project reference to the tool

{
  "title": "Demo Tool",
  "version": "0.1.0-*",

  "buildOptions": {
    "emitEntryPoint": true
  },

  "tools": {
    "DemoTool": {
      "version": "0.1.0-*"
    }
  }

  "frameworks": {
    "netcoreapp1.0": {
      "imports": "portable-net452+win81",
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.0.0-rc2-3002702",
          "type": "platform"
        }
      }
    }
  }
}

Execute dotnet restore

Expected behavior

dotnet restore executes successfully.

dotnet demo-tool executes successfully and “Hello World” is written to the console output.

Actual behavior

dotnet restore fails:

Unable to resolve ‘DemoTool (>= 0.1.0)’ for ‘.NETCoreApp,Version=v1.0’.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview1-002702)

Product Information:
 Version:     1.0.0-preview1-002702
 Commit Sha:  6cde21225e

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
blackdwarfcommented, May 25, 2016

@Antaris @GrantErickson this is not supported for RC2. You have to package your tool as a Nuget package. However, you don’t have to have a feed, you can restore it using the -f switch to dotnet restore.

We are thinking about whether to add this feature going forward.

1reaction
liamdawsoncommented, Feb 11, 2017

@BrainCrumbz in order not to litter this issue with unrelated comments, I’ve moved that discussion to an issue on my repo: https://github.com/liamdawson/DotNet.DevFeed/issues/4

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can't I reference my class library?
I right click the Bin folder or Project and select Add Reference, then select my Class Library Project, it adds the 15 or...
Read more >
Troubleshoot .NET tool usage issues
A common reason for failure is that the tool name isn't correct. This can happen because of mistyping, or because the tool has...
Read more >
Projects fail to build in 15.8.0 due to errors from Microsoft. ...
I have several projects that are now failing to build in 15.8. Both were building in 15.7. These projects don't have any NuGet...
Read more >
1. Solutions and Projects - Mastering Visual Studio .NET ...
NET-based software development: solutions and projects. Everything that you do with VS.NET will revolve around these two concepts, so a sound understanding of ......
Read more >
Unable to resolve dependencies of NuGet packages
Clear the NuGet cache files. You do this in the following way: In the toolbar of Visual Studio, navigate to Tools » NuGet...
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