Since you’re using core22 as base, build-package will use Ubuntu’s 22.04 sources for apt, which I believe doesn’t include dotnet-sdk-8.0, but does dotnet-sdk-7.0 .
That being said, there’s a mechanism on recent versions of Snapcraft to include custom apt sources. This doc might help things get clearer, I hope.
I already tried it. Error was the same - such package does not exist.
I downgraded to .Net 7 so now I’m able to build snap.
I understand about adding new repositories from Ubuntu 23 to Ubuntu 22 image used for building snap, but i’m not ready to do it since I suppose they are not added by default in Ubuntu 22 for a compatibility reason. And if I do it, I’be solving those issues.
@siarhei_kuchuk Hello, I am one of the .NET package maintainers. I currently work on backporting .NET 8 to Ubuntu 22.04 LTS (Jammy Jellyfish). The review process will take some time until it lands in the archive, but you can expect .NET 8 to be accessible on core22 until the end of this year.