Problem with adding the DLL

Jun 13, 2009 at 11:33 PM

Hello Guys,

I am just a beginner, and I am trying to add this dll to my application as a test. But when I did, and then ran, it gave me this exception:

System.BadImageFormatException was unhandled
  Message="Could not load file or assembly 'GMap.NET.Core, Version=1.2.4.7, Culture=neutral, PublicKeyToken=b85b9027b614afef' or one of its dependencies. An attempt was made to load a program with an incorrect format."
  Source="gps_track"
  FileName="GMap.NET.Core, Version=1.2.4.7, Culture=neutral, PublicKeyToken=b85b9027b614afef"
  FusionLog="=== Pre-bind state information ===\r\nLOG: User = Khaled-PC\\Khaled\r\nLOG: DisplayName = GMap.NET.Core, Version=1.2.4.7, Culture=neutral, PublicKeyToken=b85b9027b614afef\n (Fully-specified)\r\nLOG: Appbase = file:///C:/Users/Khaled/Documents/Visual Studio 2008/Projects/gps_track/gps_track/bin/Debug/\r\nLOG: Initial PrivatePath = NULL\r\nCalling assembly : gps_track, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.\r\n===\r\nLOG: This bind starts in default load context.\r\nLOG: No application configuration file found.\r\nLOG: Using machine configuration file from C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\config\\machine.config.\r\nLOG: Post-policy reference: GMap.NET.Core, Version=1.2.4.7, Culture=neutral, PublicKeyToken=b85b9027b614afef\r\nLOG: Attempting download of new URL file:///C:/Users/Khaled/Documents/Visual Studio 2008/Projects/gps_track/gps_track/bin/Debug/GMap.NET.Core.DLL.\r\nERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.\r\n"
  StackTrace:
       at gps_track.Program.Main()
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 



For a fact, the problem is not with the dll, I am pretty much certain that the problem is with me. But what should I do!! I just copied and pasted the DEMO program and added the controls as it is.
What else should I do??
Thanks

 

Jun 14, 2009 at 2:10 PM
Edited Jun 14, 2009 at 2:11 PM

What should I do??

It seems that there is something wrong with calling the image... I am not sure.

It stops at:

InitializeComponent();

Any HELP!!!!!

Coordinator
Jun 14, 2009 at 2:25 PM

there is two dll: GMap.NET.Core.dll, GMap.NET.WindowsForms.dll(or GMap.NET.WindowsPresentation.dll). If you default cache then also System.Data.SQLite.dll

Jun 14, 2009 at 6:09 PM
Edited Jun 14, 2009 at 6:22 PM

Thanks radioman for your reply.

I did add both dlls (GMap.NET.Core.dll and GMap.NET.WindowsForms.dll). And as you said, I also added System.Data.SQLite.dll, but still I get the same error.

The exception says:

TITLE: BadImageFormatException was unhandled

Could not load file or assembly 'GMap.NET.WindowsForms, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b85b9027b614afef' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Any other solution!!?

Coordinator
Jun 14, 2009 at 6:28 PM

64bit?

Jun 14, 2009 at 11:27 PM

Yes the computer that I am using is 64-bit. But, the EXE program that you have with the DLL zip works fine. So, is problem due to compiling or what???

Coordinator
Jun 15, 2009 at 5:18 AM

if you target only 64bit you must recompile all projects wit it(and use 64bit sqlite dll), or set target to x86, so it works enywhere

Jun 15, 2009 at 11:53 AM

Thanks Radioman!

I did change the configuration of my project to x86 and actually the dll worked FINE :D :D

But my question now, if I want to help out writing extra stuff in this dll, should I also make the project on x86 processors or what??

Thanks soo much, and I will test this neet dll.

Coordinator
Jun 15, 2009 at 12:38 PM

yes, by default it's compiled to x86, so if you want to use it, your projects must be x86 too, if you want 64bits you must recompile all projects to 64bits