This version of Microsoft.AspNetCore.All is only compatible with the netcoreapp2.1 target framework

后端 未结 10 1214
无人共我
无人共我 2021-02-04 23:24

When I try to publish my application to the web server after upgrading to .NET Core 2.1 from 2.0, I get this message: \"This version of Microsoft.AspNetCore.All is only compatib

相关标签:
10条回答
  • 2021-02-05 00:20

    What helped me is just deleting the .pubxml file(s) under the Properties > PublishProfiles folder and then recreating the publish profile again.

    0 讨论(0)
  • 2021-02-05 00:22

    To follow on from joakimja's post, you can also update the .pubxml file via the VS2017 IDE. Right click on your project and select "publish" and then click "configure" on the "trouble shooting info" row, then go to the "settings" tab, here you can set the "Target Framework" - in fact this should have automatically updated to "netcoreapp2.1" just by opening the dialog. Click "Save" and this will update the target framework in the pubxml file. Then try publishing again.

    0 讨论(0)
  • 2021-02-05 00:23
    1. You possibly need to do clean on the project first.
    2. Right click on the Project File in Visual Studio.
    3. Click the properties select the Application -> Target Framework drop down and choose the version of .Net Core Framework you are wanting to use.
    4. Rebuild your solution.
    0 讨论(0)
  • 2021-02-05 00:23

    I ran into the same problem (error) when trying to deploy my upgraded solution to AWS Lambda using:

    dotnet lambda deploy-serverless

    It turned out that I'd forgotten to update my aws-lambda-tools-defaults.json file.

    "framework"     : "netcoreapp2.1",
    

    Adding for others in the same situation.

    0 讨论(0)
提交回复
热议问题