[mapguide-users] MGOS 2.2 Beta with .net Problems

Greg gbneff at cid.utah.gov
Thu Dec 2 17:31:38 EST 2010


I am trying to create a .net application with Mapguide.
windows 7 64bit 
vs 2010
.net 2.0

I have created a basic weblayout which I am able to view in a browser when I
view the layout from Maestro.

I am trying to view the layout using the following code:

<%@ Page Language="C#" debug="true" AutoEventWireup="true"
CodeBehind="Cid_Map.aspx.cs" Inherits="Cid_Map.Cid_Map" %>
<%@ Import Namespace="OSGeo.MapGuide" %>

<%
    try
    {
        MapGuideApi.MgInitializeWebTier(@"C:\Program Files
(x86)\OSGeo\MapGuide\Web\www\webconfig.ini");
        MgUserInformation userinfo = new
OSGeo.MapGuide.MgUserInformation("Anonymous", "");
        MgSite site = new MgSite();
        site.Open(userinfo);
        String sessionId = site.CreateSession();
        String webLayout = "Library://layouts/Cid_Map_Basic.WebLayout";
    }
    catch (Exception e)
    {
        Response.Write(e.Message);
    }
%>


<!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>
    <title>CID_Map</title>
</head>

        <frameset rows="0.*" border="0" framespacing="0">
        <frame />

        <frame src="/mapguide/mapviewernet/ajaxviewer.aspx?SESSION=<%=
sessionId %>&WEBLAYOUT=<%= webLayout %>" name="ViewerFrame" />
        
        </frameset>

</html>

The code compiles but I receive the following error at runtime:

Server Error in '/Cid_Map' Application.
--------------------------------------------------------------------------------

Compilation Error 
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately. 

Compiler Error Message: CS0103: The name 'sessionId' does not exist in the
current context

Source Error:

 

[No relevant source lines]
 

Source File:    Line: 0 



Show Detailed Compiler Output:


c:\windows\system32\inetsrv>
"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\csc.exe" /t:library
/utf8output
/R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll"
/R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\cid_map\ebe59763\904b562e\assembly\dl3\7339b2ed\005f0c6d_3bf2ca01\MapGuideDotNetApi.DLL"
/R:"C:\Windows\assembly\GAC_64\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll"
/R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\cid_map\ebe59763\904b562e\assembly\dl3\3eb17a0f\00086656_3bf2ca01\OSGeo.MapGuide.MapGuideCommon.DLL"
/R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\cid_map\ebe59763\904b562e\assembly\dl3\7a6e9e6b\0073ab4b_3bf2ca01\OSGeo.MapGuide.PlatformBase.DLL"
/R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\cid_map\ebe59763\904b562e\assembly\dl3\bfe246ee\e537c4a6_6a92cb01\Cid_Map.DLL"
/R:"C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll"
/R:"C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll"
/R:"C:\Windows\assembly\GAC_64\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll"
/R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\cid_map\ebe59763\904b562e\assembly\dl3\8662482b\00168d5d_3bf2ca01\OSGeo.MapGuide.Web.DLL"
/R:"C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll"
/R:"C:\Windows\assembly\GAC_64\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll"
/R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll"
/R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorlib.dll"
/R:"C:\Windows\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll"
/R:"C:\Windows\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll"
/R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\cid_map\ebe59763\904b562e\assembly\dl3\9ccfd264\000b2242_3bf2ca01\OSGeo.MapGuide.Foundation.DLL"
/R:"C:\Windows\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll"
/R:"C:\Windows\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll"
/R:"C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll"
/R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\cid_map\ebe59763\904b562e\assembly\dl3\c3a0b290\00658444_3bf2ca01\OSGeo.MapGuide.Geometry.DLL"
/R:"C:\Windows\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll"
/out:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\cid_map\ebe59763\904b562e\App_Web_cid_map.aspx.cdcab7d2.nyo5ds1z.dll"
/D:DEBUG /debug+ /optimize-
/win32res:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\cid_map\ebe59763\904b562e\dxcs1aed.res" /w:4 /nowarn:1659;1699;1701 
"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\cid_map\ebe59763\904b562e\App_Web_cid_map.aspx.cdcab7d2.nyo5ds1z.0.cs"
"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\cid_map\ebe59763\904b562e\App_Web_cid_map.aspx.cdcab7d2.nyo5ds1z.1.cs"


Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.4927
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

c:\Program Files (x86)\OSGeo\MapGuide\Web\www\Cid_Map\Cid_Map.aspx(31,72):
error CS0103: The name 'sessionId' does not exist in the current context
c:\Program Files (x86)\OSGeo\MapGuide\Web\www\Cid_Map\Cid_Map.aspx(31,99):
error CS0103: The name 'webLayout' does not exist in the current context

 




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4952;
ASP.NET Version:2.0.50727.4955 

Does anyone know why this is happening?  I am new to Mapguide Open Source
and asp.net and way behind the times.  The last work I did was on Mapguide
6.5.

-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/MGOS-2-2-Beta-with-net-Problems-tp5797915p5797915.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list