Newbie & "Could not load file or assembly"

Topics: Help
Jan 13, 2012 at 1:40 PM

Afternoon all - hope that Friday is putting you in a tolerant mood for a newbie who may be committing a schoolboy error :-)

OK - I'm in my early days of developing with VB2010 .Net - getting on fine with standard controls.

I'm trying to add the GMap.Net control to use in a rudimentary manner. I think I have installed the control OK - I can see it in my Toolbox, I can add the control to my project, and it shows up in my .NET references.

When I try the app, I get a message of the form

An error occurred creating the form. See Exception.InnerException for details.  The error is: Could not load file or assembly 'GMap.NET.WindowsForms, Version=, Culture=neutral, PublicKeyToken=b85b9027b614afef' or one of its dependencies. The system cannot find the file specified.

Is this a physical file location issue - ie should the dll be in a particular place or is it sufficient that the Project Reference cites the correct location of the .dll? (I suspect the latter). Elsewhere, I have seen reference to the Global Assembly Cache and the use of the gacutil.exe tool, but should I be needing to use this with .Net 4.0? (as it happens, I don't appear to have it with Visual Basic 2010 Express.

Any suggestions?

Jan 13, 2012 at 1:46 PM
Edited Jan 13, 2012 at 1:46 PM

add GMap.NET.Core.dll and GMap.NET.WindowsForms.dll to your references

Jan 13, 2012 at 2:04 PM

Thanks for coming back to me radioman - I can see them both in my references and the path is correct - they are present in the indicated path

I note that their runtime is v2.0.50727 (from v1.6.0.0 which I think is the latest download) - is this relevant?

I tried to include a screenshot of my references and although it pasted OK I could see it locally, it didn't seem to be transmitted to that end



Jan 13, 2012 at 2:17 PM

progress - following on from a post on a different thread, I tracked down gacutil and used the -i option to add these two dlls to the global assembly cache and I can now start up the form and see my base map - Result!

Just for my future reference, should I be adding things into the global assembly cache as a matter of course?



Jan 13, 2012 at 2:17 PM

runtime version is determined by your applications .net target version, meaning it will work on any target and on any cpu anyway...

Jan 13, 2012 at 2:24 PM

you can add dlls to global cache but thats unnecessary