This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 5760 - Could not link assemblies: System.ArgumentException: Path is empty
: Could not link assemblies: System.ArgumentException: Path is empty
Status: RESOLVED FIXED
Product: MonoMac
Classification: Desktop
Component: Bindings
: unspecified
: Macintosh Mac OS
: --- normal
: ---
Assigned To: Bugzilla
:
:
:
:
  Show dependency treegraph
 
Reported: 2012-06-19 15:16 EDT by shill
Modified: 2012-11-15 22:01 EST (History)
5 users (show)

See Also:
Tags:
Test Case URL:
External Submit: ---


Attachments
app (941 bytes, text/plain)
2012-06-22 18:34 EDT, shill
Details
DLL (4.29 KB, text/plain)
2012-06-22 18:35 EDT, shill
Details
test project (312.94 KB, application/x-zip-compressed)
2012-06-25 10:18 EDT, shill
Details
mmp.zip (2.44 MB, application/zip)
2012-06-27 08:45 EDT, Rolf Bjarne Kvinge
Details

Description shill 2012-06-19 15:16:41 EDT
Getting exception durring "Merging Mono Runtime into app bundle"

Project is set to included Mono Runtime.
Exception occurs with either "Link All" and "Link Framework SDKs Only"
selected.



Merging Mono Runtime into app bundle
/Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/mmp
"-minos=10.6" -o
"/Users/shill/Desktop/software/CornerstoneFramework/trunk/SteamPunk/CueTagCreatorMacMain/bin/Debug"
-n "Insight 360 CueTag Creator" -a
"/Users/shill/Desktop/software/CornerstoneFramework/trunk/SteamPunk/bin/Debug/CueTagCreator.dll"
-a
"/Users/shill/Desktop/software/CornerstoneFramework/trunk/Utility/bin/Debug/Utility.dll"
-a
"/Users/shill/Desktop/software/CornerstoneFramework/trunk/Configuration/bin/Debug/Configuration.dll"
-a
"/Users/shill/Desktop/software/CornerstoneFramework/trunk/Log4NetWrapper/bin/Debug/Log4NetWrapper.dll"
-a
"/Users/shill/Desktop/software/CornerstoneFramework/trunk/SteamPunk/SteamPunkDesktop/bin/Debug/SteamPunkDesktop.dll"
-a
"/Users/shill/Desktop/software/CornerstoneFramework/trunk/bin/Debug/Messaging.dll"
-a
"/Users/shill/Desktop/software/CornerstoneFramework/trunk/SteamPunk/bin/Debug/MacSupport.dll"
-a
"/Users/shill/Desktop/software/CornerstoneFramework/trunk/SteamPunk/SteamPunkMessaging/bin/Debug/SteamPunkMessaging.dll"
-a "/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.dll"
-a
"/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Xml.dll"
-a
"/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Core.dll"
-a
"/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Xml.Linq.dll"
-a
"/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Drawing.dll"
-a
"/Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/MonoMac.dll"
"/Users/shill/Desktop/software/CornerstoneFramework/trunk/SteamPunk/CueTagCreatorMacMain/bin/Debug/Insight
360 CueTag Creator.exe"
Could not link assemblies: System.ArgumentException: Path is empty
  at System.IO.Path.Validate (System.String path, System.String parameterName)
[0x00000] in <filename unknown>:0 
  at System.IO.Path.Validate (System.String path) [0x00000] in <filename
unknown>:0 
  at System.IO.Directory.GetParent (System.String path) [0x00000] in <filename
unknown>:0 
  at Mono.Cecil.BaseAssemblyResolver.GetCurrentMonoGac () [0x00000] in
<filename unknown>:0 
  at Mono.Cecil.BaseAssemblyResolver.GetDefaultMonoGacPaths () [0x00000] in
<filename unknown>:0 
  at Mono.Cecil.BaseAssemblyResolver.GetGacPaths () [0x00000] in <filename
unknown>:0 
  at Mono.Cecil.BaseAssemblyResolver.GetAssemblyInGac
(Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters
parameters) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference
name, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 
  at Mono.Linker.AssemblyResolver.Resolve (Mono.Cecil.AFailed to link
/Users/shill/Desktop/software/CornerstoneFramework/trunk/SteamPunk/CueTagCreatorMacMain/bin/Debug/Insight
360 CueTag Creator.exessemblyNameReference name, Mono.Cecil.ReaderParameters
parameters) [0x00000] in <filename unknown>:0 
  at Mono.Linker.LinkContext.Resolve (IMetadataScope scope) [0x00000] in
<filename unknown>:0 
  at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences
(Mono.Cecil.AssemblyDefinition assembly) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences
(Mono.Cecil.AssemblyDefinition assembly) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences
(Mono.Cecil.AssemblyDefinition assembly) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences
(Mono.Cecil.AssemblyDefinition assembly) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences
(Mono.Cecil.AssemblyDefinition assembly) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.LoadReferencesStep.ProcessAssembly
(Mono.Cecil.AssemblyDefinition assembly) [0x00000] in <filename unknown>:0 
  at Mono.Lin
ker.Steps.BaseStep.Process (Mono.Linker.LinkContext context) [0x00000] in
<filename unknown>:0 
  at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000]
in <filename unknown>:0 
  at MonoMac.Tuner.Linker.Run (Mono.Linker.Pipeline pipeline,
Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0 
mmp exited with code 1
Comment 1 shill 2012-06-19 15:18:02 EDT
MonoDevelop 3.0.3.2
Installation UUID: 1cbc3b4f-5129-4caa-b5b5-4fd07472620c
Runtime:
    Mono 2.10.9 (tarball)
    GTK 2.24.10
    GTK# (2.12.0.0)
    Package version: 210090011
Apple Developer Tools:
     Xcode 4.2 (828)
     Build 4C199
Monotouch: 5.2.12
Mono for Android not installed
Build information:
    Release ID: 30003002
    Git revision: 7bf6ac0ca43c1b12703176ad9933c3484c05c84c-dirty
    Build date: 2012-06-16 04:36:10+0000
    Xamarin addins: 62ad7268d38c2ece7e00dc32960bd3bdab8fec38
Operating System:
    Mac OS X 10.6.8
    Darwin shill-iMac.local 10.8.0 Darwin Kernel Version 10.8.0
        Tue Jun  7 16:33:36 PDT 2011
        root:xnu-1504.15.3~1/RELEASE_I386 i386
Comment 2 Rolf Bjarne Kvinge 2012-06-21 16:55:50 EDT
This looks like it can't find mono, which is quite strange.

Do you have a test case I can try out to reproduce this?
Comment 9 Rolf Bjarne Kvinge 2012-06-21 19:16:14 EDT
Can you run "monodis --assemblyref <assembly>" on both your main executable and
the library in question?
Comment 10 shill 2012-06-22 18:34:56 EDT
Created attachment 2104 [details]
app

Output Attached
Comment 11 shill 2012-06-22 18:35:32 EDT
Created attachment 2105 [details]
DLL
Comment 12 Rolf Bjarne Kvinge 2012-06-25 05:10:36 EDT
Unfortunately I can't see anything wrong in the assembly references.

However if it is a matter of referencing a specific library, does it happen if
you create a new project from a template and then reference that library 
(you'll likely have to add some dummy code to actually use some type from the
library, otherwise the compiler will not add a reference to it)? If that also
reproduces the issue, it would be enough to just get access to the library (the
binary, not the source code).
Comment 13 shill 2012-06-25 10:18:43 EDT
Created attachment 2112 [details]
test project

Attached is a test.zip containing a test project.

All I did was referenced the .NET assemble dll and build the project in Debug
mode.
Comment 14 Rolf Bjarne Kvinge 2012-06-26 10:59:51 EDT
Thanks for the test project, I can reproduce this now.
Comment 15 Rolf Bjarne Kvinge 2012-06-27 08:45:52 EDT
Created attachment 2124 [details]
mmp.zip

I believe the issue is that you're not including all the assemblies your
referenced assemblies references.

For instance if you reference foo.dll, and foo.dll references bar.dll, you need
to add a reference to bar.dll too.

Unfortunately the error reporting is not optimal, so I'm attaching another mmp
binary with better error reporting (in particular it will tell you which
assembly it can't find if the problem is what I think it is).

To install it:
* Backup
/Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/mmp
somewhere.
* Unzip mmp from the attached zip file and put it in
/Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/
* Rebuild your project and you should get better error reporting
Comment 16 shill 2012-06-27 12:01:34 EDT
using the attached mmp I get:

mmp exited with code 134

---------------------- Done ----------------------
Comment 17 shill 2012-06-27 12:21:35 EDT
I used the attached mmp on my build server and this is what I got:

error MM0000: Unexpected error - Please fill a bug report at
http://bugzilla.xamarin.com
System.FormatException: Index (zero based) must be greater than or equal to
zero and less than the size of the argument list.
  at System.String.FormatHelper (System.Text.StringBuilder result,
IFormatProvider provider, System.String format, System.Object[] args) [0x00000]
in <filename unknown>:0 
  at System.String.Format (IFormatProvider provider, System.String format,
System.Object[] args) [0x00000] in <filename unknown>:0 
  at System.String.Format (System.String format, System.Object[] args)
[0x00000] in <filename unknown>:0 
  at MonoMac.Bundler.Driver.Compile () [0x00000] in <filename unknown>:0 
  at MonoMac.Bundler.Driver.Pack (IList`1 unprocessed) [0x00000] in <filename
unknown>:0 
  at MonoMac.Bundler.Driver.Main2 (System.String[] args) [0x00000] in <filename
unknown>:0 
  at MonoMac.Bundler.Driver.Main (System.String[] args) [0x00000] in <filename
unknown>:0 
mmp exited with code 1
Comment 18 shill 2012-06-27 12:24:32 EDT
Sorry, that last comment was the result of building with the project set to 
"Don't Link".
This is what I get with "Link All":

error MM2002: Can not resolve reference: System.Web.Razor, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
mmp exited with code 1
Comment 19 Rolf Bjarne Kvinge 2012-06-27 13:03:04 EDT
This means you need to add a reference to System.Web.Razor.
Comment 20 Allie Miller 2012-07-16 14:02:31 EDT
Created attachment 2203 [details]
MainActivity.java

Sent in on July 16th
Comment 21 Allie Miller 2012-07-16 14:03:14 EDT
Created attachment 2204 [details]
Main.axml

Sent in on July 16th as a follow-up.
Comment 22 Allie Miller 2012-07-16 14:03:52 EDT
Created attachment 2205 [details]
Activity1.cs

Sent in on July 16th
Comment 23 Rolf Bjarne Kvinge 2012-07-16 14:05:33 EDT
Allie: did you confuse this bug with another one?
Comment 27 Sebastien Pouliot 2012-10-30 20:57:35 EDT
Marek, I was trying the "test project" attachment and got this:


/Library/Frameworks/Mono.framework/Versions/2.11.5/bin/mcs /noconfig
"/r:/Library/Frameworks/Mono.framework/Versions/2.11.5/lib/mono/4.0/mscorlib.dll"
-nostdlib "/out:/Users/poupou/Downloads/test/testApp/bin/Debug/testApp.exe"
"/r:/Library/Frameworks/Mono.framework/Versions/2.11.5/lib/mono/4.0/System.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.11.5/lib/mono/4.0/System.Xml.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.11.5/lib/mono/4.0/System.Core.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.11.5/lib/mono/4.0/System.Xml.Linq.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.11.5/lib/mono/4.0/System.Drawing.dll"
"/r:/Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/MonoMac.dll"
"/r:/Users/poupou/Downloads/test/SteamPunkDesktop.dll"
"/r:/Users/poupou/Downloads/test/lib2/bin/Debug/lib2.dll" /nologo /warn:4
/debug:full /optimize- /codepage:utf8 /platform:x86 "/define:DEBUG"  /t:exe
"/Users/poupou/Downloads/test/testApp/MainWindow.cs"
"/Users/poupou/Downloads/test/testApp/MainWindowController.cs"
"/Users/poupou/Downloads/test/testApp/MainWindow.designer.cs"
"/Users/poupou/Downloads/test/testApp/Main.cs"
"/Users/poupou/Downloads/test/testApp/AppDelegate.cs"
"/Users/poupou/Downloads/test/testApp/AppDelegate.designer.cs" 


Unhandled Exception:
IKVM.Reflection.MissingMemberException: Member
'eInstruction.Cornerstone.Services.ServiceModel.IEntityTranslator`2' is a
missing member and does not support the requested operation.
  at IKVM.Reflection.MissingType.get_Attributes () [0x00000] in <filename
unknown>:0 
  at IKVM.Reflection.GenericTypeInstance.get_Attributes () [0x00000] in
<filename unknown>:0 
  at IKVM.Reflection.Type.get_IsInterface () [0x00000] in <filename unknown>:0 
  at IKVM.Reflection.Type.get_IsClass () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.ImportTypeParameterTypeConstraints
(Mono.CSharp.TypeParameterSpec spec, IKVM.Reflection.Type type) [0x00000] in
<filename unknown>:0 
  at Mono.CSharp.MetadataImporter.ImportTypeBase (Mono.CSharp.TypeSpec spec,
IKVM.Reflection.Type type) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.CreateType (IKVM.Reflection.Type type,
Mono.CSharp.TypeSpec declaringType, DynamicTypeReader dtype, Boolean
canImportBaseType) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.ImportTypes (IKVM.Reflection.Type[] types,
Mono.CSharp.Namespace targetNamespace, Boolean hasExtensionTypes) [0x00000] in
<filename unknown>:0 
  at Mono.CSharp.StaticImporter.ImportAssembly (IKVM.Reflection.Assembly
assembly, Mono.CSharp.RootNamespace targetNamespace) [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.StaticLoader.LoadReferences (Mono.CSharp.ModuleContainer
module) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename
unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: IKVM.Reflection.MissingMemberException:
Member 'eInstruction.Cornerstone.Services.ServiceModel.IEntityTranslator`2' is
a missing member and does not support the requested operation.
  at IKVM.Reflection.MissingType.get_Attributes () [0x00000] in <filename
unknown>:0 
  at IKVM.Reflection.GenericTypeInstance.get_Attributes () [0x00000] in
<filename unknown>:0 
  at IKVM.Reflection.Type.get_IsInterface () [0x00000] in <filename unknown>:0 
  at IKVM.Reflection.Type.get_IsClass () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.ImportTypeParameterTypeConstraints
(Mono.CSharp.TypeParameterSpec spec, IKVM.Reflection.Type type) [0x00000] in
<filename unknown>:0 
  at Mono.CSharp.MetadataImporter.ImportTypeBase (Mono.CSharp.TypeSpec spec,
IKVM.Reflection.Type type) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.CreateType (IKVM.Reflection.Type type,
Mono.CSharp.TypeSpec declaringType, DynamicTypeReader dtype, Boolean
canImportBaseType) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.ImportTypes (IKVM.Reflection.Type[] types,
Mono.CSharp.Namespace targetNamespace, Boolean hasExtensionTypes) [0x00000] in
<filename unknown>:0 
  at Mono.CSharp.StaticImporter.ImportAssembly (IKVM.Reflection.Assembly
assembly, Mono.CSharp.RootNamespace targetNamespace) [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.StaticLoader.LoadReferences (Mono.CSharp.ModuleContainer
module) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename
unknown>:0
Comment 28 Marek Safar 2012-11-13 03:30:19 EST
Fixed the compiler issue.
Comment 29 Sebastien Pouliot 2012-11-15 22:01:31 EST
The next version of MMP will provide better error message when a required
assembly cannot be resolved. E.g.

error MM2001: Could not link assemblies. Reason: Failed to resolve assembly:
'Ionic.Zlib, Version=1.9.1.5, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c'

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