I have a dotnet core project I would like to package as a snap.
However following the "Create your first snap" tutorial and using the dotnet plugin leads to the following error:
The plugin used by part 'my-part' does not support snaps using base 'core18'
What are my options here, am I somehow targeting the wrong version?
Is the dotnet plugin out of date or not supported?
Should I use a different plugin like dump to use already built binaries?
I have discovered the answer and it's bad news for dotnet core developers
The dotnet plugin has not been updated to use base 'core18'
However if you change the base to just 'core' then the plug in does work, but only if you target dotnet core 2.0 or older.
Sadly my project is dotnet core 2.1. Trying to build mine gives:
After looking at the snapcraft source code for the plugin, it appears there is a hidden and completely undocumented option to specify the version of dotnet core to use. For me setting as follows allowed the build to continue:
The snapcraft code attempts to find a match in this JSON file on the version-runtime field.
However resolving this just allowed me to run into the next bug which occurs after the dotnet build is complete:
Googling this it appears this is a python error, not a dotnet build error
There is a pre-existing bug report for it at Snapcraft fails when snapping .net core console application.
In the mean time I will try prebuilding a selfcontained app and using the dump plugin to make the snap.