Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tool install with nuget error should not display the temp project in output #9125

Closed
peterhuene opened this issue Feb 28, 2018 · 1 comment · Fixed by dotnet/cli#8734
Closed
Assignees
Labels
Milestone

Comments

@peterhuene
Copy link
Contributor

Steps to reproduce

See related issue #9122.

dotnet install tool Microsoft.Dotnet.Watcher.Tools -g

Expected behavior

The temp project path should not appear in the output by default:

$ dotnet install tool Microsoft.Dotnet.Watcher.Tools -g
error NU1212: Invalid project-package combination for Microsoft.DotNet.Watcher.Tools 2.0.0. DotnetToolReference project style can only contain references of the DotnetTool type
The tool package could not be restored.
Tool 'Microsoft.Dotnet.Watcher.Tools' failed to install.

Actual behavior

The temp project path appears in the output:

$ dotnet install tool Microsoft.Dotnet.Watcher.Tools -g
/var/folders/rl/m1rv1rxd643gpwspqrbxy76r0000gn/T/w1heen5l.wc5/yh505uu5.u4i.csproj : error NU1212: Invalid project-package combination for Microsoft.DotNet.Watcher.Tools 2.0.0. DotnetToolReference project style can only contain references of the DotnetTool type
The tool package could not be restored.
Tool 'Microsoft.Dotnet.Watcher.Tools' failed to install.

Environment data

$ dotnet --info
.NET Command Line Tools (2.1.300-preview2-008266)

Product Information:
 Version:            2.1.300-preview2-008266
 Commit SHA-1 hash:  6fb919f433

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx-x64
 Base Path:   /Users/peterhuene/src/cli/bin/2/osx-x64/dotnet/sdk/2.1.300-preview2-008266/

Microsoft .NET Core Shared Framework Host

  Version  : 2.1.0-preview2-26131-06
  Build    : b13a0d5c331f374afd35ded57b9a4b4ab128864c
@peterhuene peterhuene self-assigned this Feb 28, 2018
@peterhuene
Copy link
Contributor Author

peterhuene commented Mar 6, 2018

@KathleenDollard Examples with the fix applied for your review:

$ dotnet install tool -g --source https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json --version 2.1.0-preview2-\* dotnet-watch
warning NU1603: restore depends on dotnet-watch (>= 2.1.0-preview2-) but dotnet-watch 2.1.0-preview2- was not found. An approximate best match of dotnet-watch 2.1.0-preview2-28177 was resolved.
If there were no additional instructions, you can type the following command to invoke the tool: dotnet-watch
Tool 'dotnet-watch' (version '2.1.0-preview2-28177') was successfully installed.
$ dotnet install tool -g --source https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json dotnet-watch
error NU1103: Unable to find a stable package dotnet-watch with version
error NU1103:   - Found 264 version(s) in aspnetcore-dev [ Nearest version: 2.1.0-preview1-27934 ]
error NU1103:   - Found 0 version(s) in /Users/peterhuene/src/cli/bin/2/osx-x64/dotnet/sdk/NuGetFallbackFolder
The tool package could not be restored.
Tool 'dotnet-watch' failed to install.
$ dotnet install tool Microsoft.Dotnet.Watcher.Tools -g
error NU1212: Invalid project-package combination for Microsoft.DotNet.Watcher.Tools 2.0.0. DotnetToolReference project style can only contain references of the DotnetTool type
The tool package could not be restored.
Tool 'microsoft.dotnet.watcher.tools' failed to install.
$ dotnet install tool -g foo
warning NU1701: Package 'Foo 1.0.7.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.
error NU1212: Invalid project-package combination for Foo 1.0.7.2. DotnetToolReference project style can only contain references of the DotnetTool type
The tool package could not be restored.
Tool 'foo' failed to install.

Note that this continues to colorize the NuGet warnings in yellow and errors in red. The custom filtering is only applied when using the default verbosity level of quiet is used; otherwise, the filtering is disabled and MSBuild inherits the stdout/stderr handles and paths to the temp project will be displayed in diagnostic messages. This is because the other verbosity levels may use a different format and the intention of the verbosity option is for users to get more visibility into the restore operation in case there is a problem.

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@msftgits msftgits added this to the 2.1.3xx milestone Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants