Unable to include project reference to CLI tool
See original GitHub issueSteps to reproduce
Create two .NET Core projects
- Class library representing the tool (
DemoTool
) – AddProgram.cs
withMain(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:
- Created 7 years ago
- Reactions:2
- Comments:18 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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 todotnet restore
.We are thinking about whether to add this feature going forward.
@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