none
.net core3.0 CLI 使用dotnet tool install -g dotnet-ef命令出错 RRS feed

  • 问题

  • 如图,我按照官方教程使用vscode与.net core 3 SDK进行web开发  ef框架工具无法安装 命令也是教程上的命令  不知道哪里出错了

    附上教程 地址:mvc教程


    • 已编辑 BeTheBest 2019年11月23日 11:13
    2019年11月23日 9:15

答案

  • 你好,

    貌似你使用的donet 版本是3.0.0, 这个tool目前只支持3.0.1,解决方案就是升级到3.0.1 使用最新的dot core 版本。

    另外有个workaround,你可以安装3.0的EF。 代码如下:

    dotnet tool install --global dotnet-ef --version 3.0.0


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • 已标记为答案 BeTheBest 2019年11月27日 3:28
    2019年11月25日 2:25

全部回复

  • 你好,

    貌似你使用的donet 版本是3.0.0, 这个tool目前只支持3.0.1,解决方案就是升级到3.0.1 使用最新的dot core 版本。

    另外有个workaround,你可以安装3.0的EF。 代码如下:

    dotnet tool install --global dotnet-ef --version 3.0.0


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • 已标记为答案 BeTheBest 2019年11月27日 3:28
    2019年11月25日 2:25
  • 我在ubuntu18.04 环境下,安装了3.0.1的dotnt core.仍然无法安装。dotnet和报错信息如下。目前是按照3.0.0指定版本安装,可以通过。

    ~ » dotnet --info                                                                                                                                                                                sky@ubuntu
    .NET Core SDK (reflecting any global.json):
     Version:   3.0.101
     Commit:    bc5f8df0f5
    
    Runtime Environment:
     OS Name:     ubuntu
     OS Version:  18.04
     OS Platform: Linux
     RID:         ubuntu.18.04-x64
     Base Path:   /usr/share/dotnet/sdk/3.0.101/
    
    Host (useful for support):
      Version: 3.0.1
      Commit:  19942e7199
    
    .NET Core SDKs installed:
      3.0.101 [/usr/share/dotnet/sdk]
    
    .NET Core runtimes installed:
      Microsoft.AspNetCore.All 2.1.14 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
      Microsoft.AspNetCore.App 2.1.14 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
      Microsoft.AspNetCore.App 3.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
      Microsoft.NETCore.App 2.1.14 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
      Microsoft.NETCore.App 3.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
    
    To install additional .NET Core runtimes or SDKs:
      https://aka.ms/dotnet-download
    
    ~ » sudo dotnet tool install -g dotnet-ef                                                                                                                                                        sky@ubuntu
    error NU1202: Package dotnet-ef 3.0.1 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0) / any. Package dotnet-ef 3.0.1 supports: netcoreapp2.1 (.NETCoreApp,Version=v2.1)
    The tool package could not be restored.
    Tool 'dotnet-ef' failed to install. This failure may have been caused by:
    
    * You are attempting to install a preview release and did not use the --version option to specify the version.
    * A package by this name was found, but it was not a .NET Core tool.
    * The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
    * You mistyped the name of the tool.
    
    For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
    


    2019年11月26日 4:36
  • 你好,

    貌似你使用的donet 版本是3.0.0, 这个tool目前只支持3.0.1,解决方案就是升级到3.0.1 使用最新的dot core 版本。

    另外有个workaround,你可以安装3.0的EF。 代码如下:

    dotnet tool install --global dotnet-ef --version 3.0.0


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    首先 我安装的是.net core 3.0.1版本 其次 我两个版本都安装过 而且都会提示同样的错误 不过按照你这样制定版本安装是可以的
    2019年11月27日 3:28