Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
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.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
While trying to compile a binding project, a compile error happens.
CSC: error CS0016: Could not write to file #######, cause: Argument is out of range.
**Steps to Reproduce:**
1. Open the (private) sample app provided in the private comments below in Xamarin Studio on a Mac.
2. Rebuild the project.
An error occurs during building.
See attached build log.
**Build Date & Platform:**
=== Xamarin Studio ===
Version 5.9.4 (build 5)
Installation UUID: e01c3049-a2d2-4e0a-aad8-afe6fb627c4d
Mono 4.0.2 ((detached/c99aa0c)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400020005
=== Apple Developer Tools ===
Xcode 6.3 (7569)
=== Xamarin.iOS ===
Version: 126.96.36.1992 (Business Edition)
Build date: 2015-07-16 11:18:45-0400
=== Xamarin.Android ===
Version: 188.8.131.52 (Business Edition)
Android SDK: /Users/johnmiller/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.4 (API level 19)
5.0 (API level 21)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
=== Xamarin Android Player ===
Version: Unknown version
Location: /Applications/Xamarin Android Player.app
=== Xamarin.Mac ===
Version: 184.108.40.206 (Business Edition)
=== Build Information ===
Release ID: 509040005
Git revision: 8010a90f6e246b32364e3fb46ef2c9d1be9c9a2b
Build date: 2015-06-08 16:52:06-04
Xamarin addins: 7e93e9c3503f28770f23ce1b7eafd829919f18e8
=== Operating System ===
Mac OS X 10.10.2
That's an _extra_ large binary... and that's also the problem. The native library will be embedded inside the binding assembly, and it's likely 3GB is hitting a file format limitation somewhere.
@Marek, can you have a look and see if this is the case? If it is, it would be nice to have a better error message (resource file too big), than the current error.
For a workaround my suggestion would be to remove the native library from the binding project, and instead link with it manually (passing -gcc_flags ... to mtouch ).
Fixed the error message. The file limit is still in place as PE/COFF supports 32-bit image size only
Mono master has now support for up to 4GB output files