About Me

Friday, September 23, 2011

Could not load file or assembly 'Skybound.Gecko, Version=1.9.1.0, Culture=neutral...

Today I was faced with the trouble how to make the Geckofx component.
They asked me to launch the project and see if its working on my side.
After i launched the code on my computer, I got following exception:


System.BadImageFormatException: Could not load file or assembly 'Skybound.Gecko, Version=1.9.1.0, Culture=neutral, PublicKeyToken=3209ac31600d1857' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'Skybound.Gecko, Version=1.9.1.0, Culture=neutral, PublicKeyToken=3209ac31600d1857'
   at Zniper.Form1..ctor(ArrayList& arrayListImgHref, String xml, String webSiteURL, Dictionary`2 dic, String passedPath, ArrayList arrayOfWebSites, String browserPath, String outputPath)
   at Zniper.Code.MADCrawler.Crawl(ArrayList& arrayListImgHref, String xml, String webSiteURL, Dictionary`2 dic, String pathBaseLocation, ArrayList arrayOfWebSites, String browserPath, String outputPath) in C:\Work\Comscore\Src\Accurev\AMXM_INT\AdMetrix\src\Zniper\Code\MADCrawler.cs:line 44


=== Pre-bind state information ===
LOG: User = ....
LOG: DisplayName = Skybound.Gecko, Version=1.9.1.0, Culture=neutral, PublicKeyToken=3209ac31600d1857
 (Fully-specified)
LOG: Appbase = file:///C:/Work/Comscore/Src/Accurev/AMXM_INT/AdMetrix/src/Zniper/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : Zniper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Work\Comscore\Src\Accurev\AMXM_INT\AdMetrix\src\Zniper\bin\Debug\Zniper.exe.Config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Skybound.Gecko, Version=1.9.1.0, Culture=neutral, PublicKeyToken=3209ac31600d1857
LOG: Attempting download of new URL file:///C:/Work/Comscore/Src/Accurev/AMXM_INT/AdMetrix/src/Zniper/bin/Debug/Skybound.Gecko.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.


My configuration is Windows Vista 64bit and that's was the reason why it was not working.
The project was compiled with "Any CPU" value selected under "Platform target" property:


The solution was to change the Platform target to "x86".
After that the component started working as it should.

I hate such kind of troubles when you hitting the wall without no result. So, I hope that this post will help.

1 comment: