代码之家  ›  专栏  ›  技术社区  ›  Kyle

找不到指定的框架“microsoft.aspnetcore.app”,版本“2.1.0”

  •  25
  • Kyle  · 技术社区  · 6 年前

    我尝试将我的Web应用程序从.NET核心2.0升级到.NET核心2.1 我做到了:

    1)安装Visual Studio Professional 2017预览版15.8.0预览版1.1
    2)在此安装.NET Core 2.1.3 RC1 SDK: https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-rc1
    3)将我的所有AspNetCore Nuget包更新为最新版本。

    在做了这两件事之后,当我开始我的项目时,我会看到这个屏幕:

    HTTP错误502.5-进程失败此问题的常见原因:

    The application process failed to start
    The application process started but then stopped
    The application process started but failed to listen on the configured port 
    

    故障排除步骤:

    Check the system event log for error messages
    Enable logging the application process' stdout messages
    Attach a debugger to the application process and inspect 
    

    有关详细信息,请访问: https://go.microsoft.com/fwlink/?LinkID=808681

    在我的ASP.NET核心Web服务器输出窗口中,我得到了:

    The specified framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found.
      - Check application dependencies and target a framework version installed at:
          C:\Program Files\dotnet\
      - Installing .NET Core prerequisites might help resolve this problem:
          http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
      - The .NET Core framework and SDK can be installed from:
          https://aka.ms/dotnet-download
      - The following versions are installed:
          2.1.0-preview2-final at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.1.0-rc1-final at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    It was not possible to find any compatible framework version
    The specified framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found.
      - Check application dependencies and target a framework version installed at:
          C:\Program Files\dotnet\
      - Installing .NET Core prerequisites might help resolve this problem:
          http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
      - The .NET Core framework and SDK can be installed from:
          https://aka.ms/dotnet-download
      - The following versions are installed:
          2.1.0-preview2-final at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.1.0-rc1-final at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    
    4 回复  |  直到 6 年前
        1
  •  10
  •   Fouad Messaia    6 年前

    .NET Core 2.1 SDK将于本周发布。如果您不能等到那时,请将此添加到您的*.csproj

    <Project Sdk="Microsoft.NET.Sdk.Web">
      <PropertyGroup>
        <TargetFramework>netcoreapp2.1</TargetFramework>
        <RestoreAdditionalProjectSources>
            https://dotnetfeed.blob.core.windows.net/orchestrated-release-2-1/20180515-07/final/index.json
        </RestoreAdditionalProjectSources>
      </PropertyGroup>
    
      ....
    </Project>
    

    并从以下位置下载最终的SDK: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.1.300/dotnet-sdk-2.1.300-win-x64.exe

    有关详细信息,请访问: https://github.com/aspnet/Home/wiki/2.1.0-Early-Access-Downloads

        2
  •  8
  •   Martin Ullrich    6 年前

    通过更新所有的nuget包,您似乎已经从最初使用的rc版本(安装在您的系统上)升级到当前发布的rtm版本(因此在nuget上已经可用,但在您的系统上没有安装)。

    这个 Microsoft.AspNetCore.App nuget包应该在没有版本的情况下被引用,以便安装的工具可以选择适当的版本。

    更新.csproj文件以删除 Version 属性,仅通过以下方式引用该包:

    <ItemGroup>
      <PackageReference Include="Microsoft.AspNetCore.App" />
    </ItemGroup>
    
        3
  •  2
  •   satellite satellite    6 年前

    .NET Core sdk 2.1.300现在可用: https://www.microsoft.com/net/download/windows 安装它,这为我解决了问题。

        4
  •  1
  •   GeekyMonkey    6 年前

    看起来现在巧克力有售 https://chocolatey.org/packages/dotnetcore-sdk/2.1.300

    在正常的dotnet分发站点上还没有。疯子。