[mapguide-users] RE: Compile Error: An attempt was made to load a program with an incorrect format.

Hans Milling hm at geograf.dk
Tue Dec 20 03:17:28 EST 2011


If you look at the inner exception, you can in most cases see what
dependency/dll fails to load or else try the Dependency Walker app to see if
anything is missing. During signing of the dll files, if you forget to put
the token in one of the .il files, then this dll cannot load and everything
breaks.
Later versions of MapServer and MGOS2.2 also requires the *UnmanagedApi.dll
files to be present to be able to create the local native connection.

About referencing the dll. The inner exception will also tell you if another
version is expected and then it is because you do not do the version
redirect.
My app.config/web.config has the following section to be sure all versions
of the dll are redirected (remember to change the name if you renamed the
dll).

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="MapGuideDotNetApi"
publicKeyToken="f526c48929fda856" />
        <bindingRedirect oldVersion="1.0.0.0-10.10.10.10"
newVersion="1.0.0.1" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

Regards Hans Milling...

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Compile-Error-An-attempt-was-made-to-load-a-program-with-an-incorrect-format-tp6153978p7111048.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list