locked
App Crashes With System.IO.FileNotFoundException When I Enable Bundling Mono SDK RRS feed

  • Question

  • User20050 posted

    I have completed and tested my app, but when I try and create a .app to distribute, the creation crashes as soon as I launch it with a FileNotFoundException on a linked .exe that I use in the application. This works fine when I run in Xamarin Studio before I check the option to bundle the runtime.

    Sunday, August 11, 2013 10:52 PM

All replies

  • User20050 posted

    I turned on "link all" and I've got a new error that I can't get past by adding references.

    I can't seem to get this one to resolve though.

    error MM2002: Failed to resolve assembly: 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' mmp exited with code 1

    Sunday, August 11, 2013 11:38 PM
  • User16705 posted

    I have seen this problem myself in linking my projects. If I am understanding the problem correctly, here is what is happening:

    • A.exe references B.dll
    • B.dll references C.dll
    • C.dll cannot be found

    This seems like a deficiency in the Mono linker. Here is what I did to solve the problem:

    • A.exe references B.dll
    • B.dll references C.dll
    • A.exe references C.dll (new)

    You'll need to make sure that the main EXE references each and every DLL used by your program, even indirectly, no matter how many middleman DLLs exist between your EXE and the problem DLL.

    Hope this helps!

    Tuesday, August 13, 2013 5:14 PM
  • User20050 posted

    This is exactly what I did to fix it this morning. Link all of B's DLL's in A.

    Tuesday, August 13, 2013 5:28 PM
  • User90272 posted

    Hi! I have the same problem, but everything is linked fine in my project. I have one executable and two dlls. The executable references both dlls, but the app crashes also with System.IO.FileNotFoundException: Could not load file or assembly ...

    Does someone has some hints?

    Thursday, November 27, 2014 5:43 PM
  • User35201 posted

    So, we'd need more info than that @kbnl83. Is the FileNotFoundException you are seeing related to one of the assemblies you added to your top level dependency, or another assembly?

    In theory, mmp should be smart enough to handle this case and not require such hand holding. That is obviously not the case. I filed a bug:

    https://bugzilla.xamarin.com/show_bug.cgi?id=24954

    Could one of the reporters above attach an example if you have one handy. I'll take a look at this at some point in the future.

    Monday, December 1, 2014 3:06 PM
  • User90272 posted

    It is related to one of my assemblies. I have my main project and included the OxyPlot and OxyPlot.Gtk Project. Maybe there is a small difference to the problem of the thread opener. I didn't enabled bundling mono sdk. I execute my program with these script: https://github.com/mono/heap-shot/blob/master/MacSetup/heapshot All files are located in my Release folder, the executable, the two OxyPlot dlls and the script. When I try to use a functionality of oxyplot, the app crashes. I testet these constellation under Windows and Debian and everything works well.

    Wednesday, December 3, 2014 7:00 PM
  • User35201 posted

    @kbnl83 - I'm confused. Is your application a Xamarin.Mac one or does it use some other UI toolkit? Normally XamMac applications use our launcher, especially if they are bundled using mmp.

    Wednesday, December 3, 2014 10:53 PM
  • User35201 posted

    I closed the bug I filled (https://bugzilla.xamarin.com/show_bug.cgi?id=24954) as I'm unable to reproduce it. I tried a few projects with long chains of dependencies, and the latest Xamarin.Mac seems to resolve it correctly. Please reopen with an example if you can run into this issue.

    Friday, December 5, 2014 5:36 PM
  • User90272 posted

    Sorry for the late answer, i have a Gtk# 2.0 app. Maybe the thread opener had another problem than me, but the same error message.

    Sunday, December 7, 2014 8:11 AM
  • User35201 posted

    @kbnl83? - Sorry I don't know much about GTK#. It doesn't use any of the Xamarin.Mac stack.

    Maybe ask for here here? http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

    Monday, December 8, 2014 2:54 PM