.NET 6.0 预览版、dotnet 包、Github 操作失败

问题描述

鉴于此(缩写)Github 工作流程

   steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v2    
    - uses: actions/setup-dotnet@v1
      with:
        dotnet-version: '6.0.100-preview.4.21255.9'
        include-prerelease: true
    - uses: darenm/Setup-VSTest@v1

    - name: Build
      run: dotnet publish SendExplorerPlus.sln /p:Configuration=Release /p:PublishProfile=local /verbosity:minimal

我在尝试运行 dotnet bundle 时遇到错误

Run dotnet publish SendExplorerPlus.sln /p:Configuration=Release /p:PublishProfile=local /verbosity:minimal

...
  Determining projects to restore...
  Restored D:\a\sendexplorer\sendexplorer\Portal2\Portal2.csproj (in 10.21 sec).
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
  Portal2 -> D:\a\sendexplorer\sendexplorer\Portal2\bin\Release\net6.0\Portal2.dll
  It was not possible to find any compatible framework version
  The framework 'Microsoft.NETCore.App',version '2.0.0' was not found.
    - The following frameworks were found:
        6.0.0-preview.4.21253.7 at [C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\shared\Microsoft.NETCore.App]
  
  You can resolve the problem by installing the specified framework and/or SDK.
  
  The specified framework can be found at:
     - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.0.0&arch=x64&rid=win10-x64
D:\a\sendexplorer\sendexplorer\Portal2\Portal2.csproj(148,5): error MSB3073: The command "dotnet bundle" exited with code -2147450730.
Error: Process completed with exit code 1.

在过去的几个小时里,我一直在玩弄这个工作流,但找不到解决方法。有什么想法吗?

解决方法

我通过添加特定版本的 .NET SDK 解决了这个问题。即2.2.106。尝试了其他版本的 SDK,但这是我发现的唯一一个。

    - uses: actions/setup-dotnet@v1
      with:
        dotnet-version: '2.2.106'
    - uses: actions/setup-dotnet@v1
      with:
        dotnet-version: '6.0.100-preview.4.21255.9'
        include-prerelease: true

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...