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

dotnet-watch, dotnet-ef, and dotnet-user-secrets will move into the .NET Core CLI in 2.1.300 #290

Open
natemcmaster opened this Issue Feb 27, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@natemcmaster
Copy link
Member

natemcmaster commented Feb 27, 2018

Starting in .NET Core CLI 2.1.300-preview2, the following tools were added as bundled, top-level commands. These tools previously shipped as NuGet packages.

  • Microsoft.DotNet.Watcher.Tools (aka dotnet-watch)
  • Microsoft.EntityFrameworkCore.Tools.DotNet (aka dotnet-ef)
  • Microsoft.Extensions.SecretManager.Tools (aka dotnet-user-secrets)
  • Microsoft.Extensions.Caching.SqlConfig.Tools (aka dotnet-sql-cache)

Commands like dotnet watch, dotnet ef, and dotnet user-secrets can be executed on any project without needing to install the command via "dotnet restore" or "dotnet install tool". The commands are available by default in all projects.

Upgrading from stable releases of .NET Core CLI (e.g. 2.1.5)

Using these tools as a DotNetCliToolReference will no longer work. If your .csproj file has the following lines, they can be removed.

<ItemGroup>
   <DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="(all versions)" />
   <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="(all versions)" />
   <DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="(all versions)" />
   <DotNetCliToolReference Include="Microsoft.Extensions.Caching.SqlConfig.Tools" Version="(all versions)" />
</ItemGroup>

Upgrading from .NET Core CLI 2.1.300-preview1

For early-adopters who tried the 2.1.300-preview1 release, you will no longer need to run dotnet install tool -g to acquire the following tools:

  • dotnet-watch
  • dotnet-user-secrets
  • dotnet-dev-certs
  • dotnet-sql-cache
  • dotnet-ef

If you had installed these tools in 2.1.300-preview1, you can uninstall them manually by deleting corresponding files from %USERPROFILE%\.dotnet\tools\ (Windows) or $HOME/.dotnet/tools (macOS/Linux).

For discussion use aspnet/DotNetTools#399

@natemcmaster natemcmaster added this to the 2.1.0-preview2 milestone Feb 27, 2018

@aspnet aspnet locked as spam and limited conversation to collaborators Feb 27, 2018

@aspnet aspnet unlocked this conversation Feb 27, 2018

@aspnet aspnet locked as resolved and limited conversation to collaborators Feb 27, 2018

@shanselman

This comment was marked as resolved.

Copy link
Contributor

shanselman commented Feb 27, 2018

Cool, but installing them (which feels intuitive but isn't needed) shouldn't crash. What's a friendly message to solve this?

95→ C:\github\hanselminutes-core [master ≡ +0 ~0 -1 !]> dotnet install tool Microsoft.Dotnet.Watcher.Tools -g
Install failed. Failed to download package:
NuGet returned:

Failed to restore package.
WorkingDirectory:
Arguments: restore C:\Users\scott\AppData\Local\Temp\gnzjrzwo.bvk\nh3id1v4.onz.csproj --runtime win10-x64 /p:BaseIntermediateOutputPath=\"C:\Users\scott\.dotnet\toolspkgs\Microsoft.Dotnet.Watcher.Tools\2gtgbll5.42m\"
Output:   Restoring packages for C:\Users\scott\AppData\Local\Temp\gnzjrzwo.bvk\nh3id1v4.onz.csproj...
  Installing Microsoft.NETCore.DotNetAppHost 2.0.0.
  Installing Microsoft.NETCore.DotNetHostResolver 2.0.0.
  Installing NETStandard.Library 2.0.0.
  Installing Microsoft.NETCore.Platforms 2.0.0.
  Installing Microsoft.NETCore.DotNetHostPolicy 2.0.0.
  Installing Microsoft.NETCore.App 2.0.0.
  Installing Microsoft.DotNet.Watcher.Tools 2.0.0.
  Installing runtime.win-x64.Microsoft.NETCore.DotNetAppHost 2.0.0.
  Installing runtime.win-x64.Microsoft.NETCore.DotNetHostResolver 2.0.0.
  Installing runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy 2.0.0.
  Installing runtime.win-x64.Microsoft.NETCore.App 2.0.0.
C:\Users\scott\AppData\Local\Temp\gnzjrzwo.bvk\nh3id1v4.onz.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
  Restore failed in 5.89 sec for C:\Users\scott\AppData\Local\Temp\gnzjrzwo.bvk\nh3id1v4.onz.csproj.



[Nate] You've hit this issue dotnet/cli#8698. Please use aspnet/DotNetTools#399 for discussion.

@natemcmaster natemcmaster changed the title dotnet-watch and dotnet-user-secrets will move into the .NET Core CLI in 2.1.300 dotnet-watch, dotnet-ef, and dotnet-user-secrets will move into the .NET Core CLI in 2.1.300 Apr 26, 2018

@natemcmaster

This comment was marked as resolved.

Copy link
Member

natemcmaster commented Apr 26, 2018

Updated to include instructions for dotnet-ef.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.