Bug 8786 - MissingMethodException when using MemoryMappedFile.CreateFromFile in simulator
Summary: MissingMethodException when using MemoryMappedFile.CreateFromFile in simulator
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll (show other bugs)
Version: 6.1.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-12-05 18:17 UTC by Frank A. Krueger
Modified: 2012-12-06 12:30 UTC (History)
3 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description Frank A. Krueger 2012-12-05 18:17:38 UTC
When I try to use MemoryMappedFile.CreateFromFile, I get the following exception when running in the simulator:

[ERROR] FATAL UNHANDLED EXCEPTION: System.MissingMethodException: Cannot find the requested method.
  at (wrapper managed-to-native) System.IO.MemoryMappedFiles.MemoryMapImpl:mono_filesize_from_path (string)
  at System.IO.MemoryMappedFiles.MemoryMapImpl.Open (System.String path, FileMode mode, Int64 capacity, MemoryMappedFileAccess access) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedFile.cs:358 
  at System.IO.MemoryMappedFiles.MemoryMappedFile.CreateFromFile (System.String path, FileMode mode, System.String mapName, Int64 capacity, MemoryMappedFileAccess access) [0x00055] in /Developer/MonoTouch/Source/mono/mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedFile.cs:475 

The repo is simply:

using (var mm = MemoryMappedFile.CreateFromFile ("file", FileMode.Open, null, 0L, MemoryMappedFileAccess.Read)) {

  Mono JIT compiler version 2.10.11 (mono-2-10/6cee717 Thu Nov 29 17:32:29 EST 2012)
Comment 1 Sebastien Pouliot 2012-12-06 08:49:51 UTC
Rodrigo added MemoryMappedFile support last year (managed code) but some functions (inclduing the one above) are not part of mono (at least not the one used when JITing / simulator).

#if (defined (__MACH__) && defined (TARGET_ARM)) || defined (TARGET_ANDROID)
Comment 2 Rodrigo Kumpera 2012-12-06 12:30:07 UTC
Fixed on MM and bumped monotouch head. Please bump 6.0-series if this bug needs to be fixed there as well.

Notice (2018-05-21): bugzilla.xamarin.com will be switching to read-only mode on Thursday, 2018-05-25 22:00 UTC.

Please join us on Visual Studio Developer Community and GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs and copy them to the new locations as needed for follow-up. The See Also field on each Bugzilla bug will be updated with a link to its new location when applicable.

After Bugzilla is read-only, if you have new information to add for a bug that does not yet have a matching issue on Developer Community or GitHub, you can create a follow-up issue in the new location. Copy and paste the title and description from this bug, and then add your new details. You can get a pre-formatted version of the title and description here:

In special cases you might also want the comments:

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Note You need to log in before you can comment on or make changes to this bug.