[mapguide-users] how to DEBUG in asp.net + MGOS1.1 in VS.net 2005

Jackie Ng jackie.ng at aecsystems.com.au
Tue Mar 6 02:04:46 EST 2007


Hi there,

The .net API is a wrapper to the native (C++) code. So in terms of
debugging, you can only see the classes, interfaces, and properties that are
exposed natively. You can't step inside the API functions.

One of the things I find useful when debugging is catching MgException
objects and inspecting the result of GetMessage() / GetDetails(). Even if
they are MgUnclassifiedExceptions, the message does shed some useful
information.

If that fails, you can try to read the MapGuide source code and try to
follow what the method in question is doing ;-)

Regards,

- Jackie


champingfor wrote:
> 
> Hi,
> 
>     I am using  VS.net 2005 and MapGuide Open Source 1.1.0 . The MapGuide
> I Installed is binary version(the msi).
> 
>    I Create a website in vs.net 2005 ,and copy all the Dll file from .net
> viewer's bin directory to my owen bin .
> 
>   The code I wrote  like that, Compiler show the error message at "string
> sessionId = site.CreateSession();"
> 
> OSGeo.MapGuide.MgUnclassifiedException: Failed to retrieve message for
> "MgUnclassifiedException".
> 
> Because My MG version is binary version , I can't see the defination of
> the function "CreateSession()" and try to find what error happened.
> 
> Am I do wrong somewhere? And how do you find it? I mean how do you DEBUG
> the errors when you develop with MGOS?
> 
>                         Thanks!
> 
> 
> <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
> Inherits="_Default" %>
> 
> <%@ Import Namespace="OSGeo.MapGuide" %>
> <%
> 
>     MapGuideApi.MgInitializeWebTier(Server.MapPath(@"webconfig.ini"));
>     MgUserInformation userInfo = new MgUserInformation("Anonymous", "");
>     MgSite site = new MgSite();
>     site.Open(userInfo);
>     string sessionId = site.CreateSession();
>     string webLayout =
> "Library://Samples/Sheboygan/Layouts/SheboyganAsp.WebLayout";
>         
>  %>
> <!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 topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0>
>     <iframe width=100% height=100%
> src="/mapguide/mapviewernet/ajaxviewer.aspx?SESSION=<%= sessionId
> %>&WEBLAYOUT=<%= webLayout %>"
>         name="ViewerFrame" />
> </body>
> </html>
> 
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 

-- 
View this message in context: http://www.nabble.com/how-to-DEBUG-in-asp.net-%2B-MGOS1.1-in-VS.net-2005-tf3332192s16610.html#a9327064
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list