Issue while trying to snap a mono app


#1

I am new to linux & snaps. I was trying to snap a simple hello world program and created an .exe file for it using Mono.

The snapcraft.yaml file is as below :

name:  test1
version: '0.1'
summary: hello world program
description:
 Print hello world

grade: devel 
confinement: devmode 

type:
  app

apps:
  test123:
    command: mytest.sh
    environment:
       PATH: $PATH:/usr/lib/mono/4.5

parts:
  test123:
    plugin: dump
    source: .
    source-type: local
    stage-packages:
       - mono-runtime
       - libmono-corlib4.5-cil
       - libmono-system-core4.0-cil
       - libmono-system-net-http4.0-cil
       - libmono-system-runtime4.0-cil
       - libmono-system-web-extensions4.0-cil
       - libmono-system-xml4.0-cil
       - libmono-system-web4.0-cil
       - libmono-system-web-http4.0-cil
       - libmono-system-xml-linq4.0-cil
       - libmono-microsoft-csharp4.0-cil
       - libmono-http4.0-cil
       - curl

and after snapping i am getting the below error :

But even though mscorblib.dll file is present in the path /usr/lib/mono/4.5/ as in the image below. I am getting the above error.

Can someone please help me with this ?


#2

If you snap run --shell test1.test123 you’ll be dropped into a shell running in the mount namespace your app runs. If you ls or find to explore what the app can see, you should be able to figure out what’s missing.

P.S. please use ‘preformatted text’ for yaml snippets and etc. so they’re easier to read. I’ve edited your post to do this.


#3

Thanks a lot for your inputs :slight_smile: