Problems creating a snap for dotnet application(hello world)

I am trying to snap a dotnet hello world program.

The folder structure looks like this :

The snapcraft.yaml file is as below :

 name: dotnetsnap1
version: '0.1'
summary: A simple example snap for dotnet in snaps
description: A simple example snap for dotnet in snaps
grade: devel 
confinement: devmode 

type:
  app

apps:
  test1:
    command: dotnet /home/boschrexroth/Desktop/dotnet1/bin/Debug/netcoreapp2.2/dotnet1.dll

parts:
  test1:
    plugin: dump
    source: .
    stage-packages:
      - libunwind8
      - libicu55

When i try to run the snap. i get the following error :

image

Please le tme know what changes do i have to make in the snapcraft.yaml file to make the snap run.

if i run the application on console it works well :slight_smile: image

The dotnet runtime needs to be in the snap.
Maybe try and use the dotnet plugin, here is a simple hello-world app https://github.com/snapcore/snapcraft/tree/master/tests/spread/plugins/dotnet/snaps/dotnet-hello (you will need to add base: core18 to the snapcraft.yaml in that directory)

2 Likes

Thanks for your response.

I have tried what you had suggested. I changed the snapcraft.yaml with base:core18 as below :

name: dotnethello
version: '0.1'
summary: A simple example snap for dotnet in snaps
description: A simple example snap for dotnet in snaps

grade: devel 
confinement: strict 

base: core18

apps:
  test1:
    command: dotnethello

parts:
  test1:
    source: .
    plugin: dotnet

but i am getting the below error :