jincod / dotnetcore-buildpack

Heroku .NET Core Buildpack
MIT License
750 stars 360 forks source link

Error Deploy .NET6 #154

Closed chhinsras closed 2 years ago

chhinsras commented 2 years ago

➜ AppBoilerplate git:(master) ✗ git push heroku master Enumerating objects: 920, done. Counting objects: 100% (920/920), done. Delta compression using up to 4 threads Compressing objects: 100% (727/727), done. Writing objects: 100% (920/920), 1.52 MiB | 598.00 KiB/s, done. Total 920 (delta 432), reused 311 (delta 167), pack-reused 0 remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-20 stack remote: -----> Using buildpack: jincod/dotnetcore remote: -----> Core .NET app detected remote: > Installing dotnet remote: -----> Removing old cached .NET version remote: -----> Fetching .NET SDK remote: -----> Fetching .NET Runtime remote: -----> Export dotnet to Path remote: -----> Project File remote: > /tmp/build_218c3a44/server/API/API.csproj remote: -----> Project Name remote: > API remote: > publish /tmp/build_218c3a44/server/API/API.csproj for Release on heroku_output remote: remote: Welcome to .NET 5.0! remote: --------------------- remote: SDK Version: 5.0.301 remote: remote: ---------------- remote: Installed an ASP.NET Core HTTPS development certificate. remote: To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only). remote: Learn about HTTPS: https://aka.ms/dotnet-https remote: ---------------- remote: Write your first app: https://aka.ms/dotnet-hello-world remote: Find out what's new: https://aka.ms/dotnet-whats-new remote: Explore documentation: https://aka.ms/dotnet-docs remote: Report issues and find source on GitHub: https://github.com/dotnet/core remote: Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli remote: -------------------------------------------------------------------------------------- remote: Microsoft (R) Build Engine version 16.10.1+2fd48ab73 for .NET remote: Copyright (C) Microsoft Corporation. All rights reserved. remote: remote: Determining projects to restore... remote: /tmp/codon/tmp/cache/dotnet/5.0.301/sdk/sdk/5.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0. [/tmp/build_218c3a44/server/Infrastructure/Infrastructure.csproj] remote: /tmp/codon/tmp/cache/dotnet/5.0.301/sdk/sdk/5.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0. [/tmp/build_218c3a44/server/Core/Core.csproj] remote: /tmp/codon/tmp/cache/dotnet/5.0.301/sdk/sdk/5.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0. [/tmp/build_218c3a44/server/API/API.csproj] remote: ! Push rejected, failed to compile Core .NET app. remote: remote: ! Push failed remote: ! remote: ! ## Warning - The same version of this code has already been built: b33a4834bde871fbe8f25556bd8ea611562a5c9b remote: ! remote: ! We have detected that you have triggered a build from source code with version b33a4834bde871fbe8f25556bd8ea611562a5c9b remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch. remote: ! remote: ! If you are developing on a branch and deploying via git you must run: remote: ! remote: ! git push heroku <branchname>:main remote: ! remote: ! This article goes into details on the behavior: remote: ! https://devcenter.heroku.com/articles/duplicate-build-version remote: remote: Verifying deploy... remote: remote: ! Push rejected to appboilerplate. remote: To https://git.heroku.com/appboilerplate.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/appboilerplate.git'

jincod commented 2 years ago

Hello @chhinsras ,

The project is .net 6. The buildpack refer to .net core 5 version.

Make sure you use the latest version 'heroku buildpacks:set https://github.com/jincod/dotnetcore-buildpack' and clear cache if needed.

chhinsras commented 2 years ago

Hello @chhinsras ,

The project is .net 6. The buildpack refer to .net core 5 version.

Make sure you use the latest version 'heroku buildpacks:set https://github.com/jincod/dotnetcore-buildpack' and clear cache if needed.

How can I clear the cache?

I use the lastest command yes.

jincod commented 2 years ago

Clear Heroku cache https://help.heroku.com/18PI5RSY/how-do-i-clear-the-build-cache

chhinsras commented 2 years ago

https://help.heroku.com/18PI5RSY/how-do-i-clear-the-build-cache

Thank. I did not do anything, but it works now.