1

I'm developing a web application on MapGuide Open Source 2.5.2 64bit with ASP.NET. When I try to create a user session from my login.aspx page I get this error:

The type initializer for 'OSGeo.MapGuide.MapGuideApiPINVOKE' threw an exception

I am using the following code to create the session:

try
   {
    MapGuideApi.MgInitializeWebTier (string.Format ("{0} \ \ {1}", serverpath, "webconfig.ini"));
    var site = new MgSite ();
    site.Open (new MgUserInformation (userName, userPassword));
    var sessionID = site.CreateSession ();
    Session.Add ("MgSessionId", sessionID);
    return true;
   }
   catch (MgException exMg)
   {
     this.lblMessage.Text = exMg.Message;
   }

Does anyone have ideas about how to fix it? I don't found solutions on the web. Thanks

0 Answers0