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

John Love jllj3 at hotmail.com
Wed Mar 9 10:03:47 EST 2011








I have been chasing these issues for days now and I could really use some help from someone that is familiar with Mapguide. The sample map loads up just fine using the Maestro Preview tool. The problem is while trying to implement using vb.net Please see the following info.
 
When run the code below in Debug mode I get the following Error.
 
 
Could not load file or assembly 'MapGuideDotNetApi, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
 
Exception Details: System.BadImageFormatException: Could not load file or assembly 'MapGuideDotNetApi, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
 
Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
 
 
 
Mapguide installed using MapGuideOpenSource-2.2.0.5518-RC3-x64.exe
 
Windows 7 Enterprise 64 bit
IIS 7
Visual Studio 2010, asp.net, VB.net code behind.
 
With references to the following:
 
C:\Program Files\OSGeo\MapGuide\Web\www\mapviewernet\bin\MapGuideDotNetApi.dll
C:\Program Files\OSGeo\MapGuide\Web\www\mapviewernet\bin\OSGeo.MapGuide.Foundation.dll
C:\Program Files\OSGeo\MapGuide\Web\www\mapviewernet\bin\OSGeo.MapGuide.Geometry.dll
C:\Program Files\OSGeo\MapGuide\Web\www\mapviewernet\bin\OSGeo.MapGuide.MapGuideCommon.dll
C:\Program Files\OSGeo\MapGuide\Web\www\mapviewernet\bin\OSGeo.MapGuide.PlatformBase.dll
C:\Program Files\OSGeo\MapGuide\Web\www\mapviewernet\bin\OSGeo.MapGuide.Web.dll
 
Default.aspx markup:
 
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="mapguide4._Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
</body>
  
</html>
 
 
Using the following code:
   
Imports OSGeo.MapGuide
Imports System.Xml
 
 
Public Class _Default
    Inherits System.Web.UI.Page
 
 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
        Dim map As New MgMap
        
    End Sub
 
End Class
 
 
 
Everything I’ve read indicates that this may be due to 32 bitness of the dlls.
 
 
 
Thank you,
 
John  		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20110309/12e01afd/attachment.html


More information about the mapguide-users mailing list