Publish problem after updating net core version

Updating my dot net core mvc project from version 2.2 to 3.0 I got an error saying „project.assets.json doesn’t have a target for .NETCoreApp,Version=v2.2“. I deleted the mentioned JSON file which was new generated  but nothing changed. After searching for my problem in google I found this link https://github.com/dotnet/sdk/issues/1321 where similiar problems were reported. One of the answers was a good one: Delete your publish profile and try again. This worked for me and I hope for many other people out there getting this error.