Unresolved assembly reference

Feb 26, 2013 at 8:28 AM
I'm using ILMerge GUI with an application that include GMap.Net dlls.
I have this error:
Unresolved assembly reference not allowed : System.Data.SQLite.
This is the log:
AssemblyResolver: Assembly 'GMap.NET.Core' is referencing assembly 'System.Data.SQLite'.
AssemblyResolver: Attempting referencing assembly's directory.
AssemblyResolver: Did not find assembly in referencing assembly's directory.
AssemblyResolver: Attempting input directory.
AssemblyResolver: Did not find assembly in input directory.
AssemblyResolver: Attempting user-supplied directories.
AssemblyResolver: No user-supplied directories.
AssemblyResolver: Attempting framework directory.
AssemblyResolver: Did not find assembly in framework directory.
AssemblyResolver: Unable to resolve reference. (It still might be found, e.g., in the GAC.)


I don't know how resolve this, because in my application i don't have any problem when i use GMap.NET library.
Developer
Feb 26, 2013 at 8:37 AM
Hi

Did you add the SQLite assembly to the references of your project? That the application runs on your machine will not guarantee it will on other machines if the SQLite assembly is not already present there.

Basically it's not on one of the path's the assemblyresolver uses.


regards
Wim van der Vegt
Feb 26, 2013 at 9:55 AM
I add the assembly to the references of the project.

Now i have a new error:

System.Data.SQLite.PeKind = 0
The assembly 'System.Data.SQLite' is not marked as containing only managed code.
(Consider using the /zeroPeKind option -- but read the documentation first!)

I think that the error come from GMap.NET library and isn't a problem of the ILmerge.
how can I solve it?

Thanks
Developer
Feb 26, 2013 at 10:10 AM
Hi,

From the manual:
public bool AllowZeroPeKind { get; set; }
When this is set before calling Merge, then if an assembly's PeKind flag (this is the value of the field listed as .corflags in the Manifest) is zero it will be treated as if it was ILonly. This can be used to allow C++ assemblies to be merged; it does not appear that the C++ compiler writes the value as ILonly. However, if such an assembly has any non-IL features, then they will probably not be copied over into the target assembly correctly. So please use this option with caution.
Default: false
Command line option: /zeroPeKind
Seems like one of the dependencies is not as managed as it should be (to be merged). The manual also says that if you do add the switch it can fail to copy the assembly properly. I found a discussion about PDFNet containing the same issue (http://social.msdn.microsoft.com/Forums/en/vsx/thread/39a9c2d2-8782-480b-8adf-43e9a8ecc157). It mentions a PEVerify Tool that might be used to pinpoint problems.

If i read above discussion, the only solution is to remove the gmap assemly from merging. Not much i can do i'm afraid.

regards
Wim van der Vegt
Feb 26, 2013 at 10:14 AM
I add the assembly to the references of the project.

Now i have a new error:

System.Data.SQLite.PeKind = 0
The assembly 'System.Data.SQLite' is not marked as containing only managed code.
(Consider using the /zeroPeKind option -- but read the documentation first!)

I think that the error come from GMap.NET library and isn't a problem of the ILmerge.
how can I solve it?

Thanks