找不到匹配命令“dotnet-watch”的可执行文件

时间:2017-02-17 15:52:59

标签: asp.net-core .net-core

尝试使用cap = ""+Character.toUpperCase(sent.charAt(0)); for (int i = 1; i < sent.length() - 1; i++) { ..... 但却犯了错误:

  

找不到匹配命令“dotnet-watch”

的可执行文件
dotnet watch

已安装的.NET Core 1.1 SDK和.NET Core 1.1运行时

我的dotnet --version 1.0.0-rc4-0004834 文件:

.csproj

<ItemGroup> <PackageReference Include="Microsoft.AspNetCore" Version="1.0.3" /> <PackageReference Include="Microsoft.DotNet.Cli.Utils" Version="1.0.0-rc4-004771" /> <PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.0" /> <PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" /> <PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" /> <PackageReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.1.0-preview4-final" /> </ItemGroup> 已完成

我该如何解决?

1 个答案:

答案 0 :(得分:18)

将Microsoft.DotNet.Watcher.Tools添加到您的.csproj中,如下所示:

<ItemGroup>
    <DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.0.0-msbuild2-final" />
</ItemGroup>

csproj

然后执行dotnet restore和dotnet watch run

commandline