[mapguide-users] InitializeWebTier

swetha1 swetha.sub at gmail.com
Thu Feb 28 00:14:02 EST 2008


Hi,

I am trying to run the dotnetviewersample through visual studio, Which gave
me lots of errors so i have created a project in which default.aspx is
created instead of the ajaxviewersample.

Now if i want to view the map i need to include:
"Library://UISapp/UIS/Layout/layout.WebLayout"----Which i have prepared in
MapGuide Studio....

I am getting an error in the initializeWebTier
Pasting the code here sp that you guys can understand what i am trying to do
exactly....

Please help me out.....


<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs"
Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Collections.Specialized" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="OSGeo.MapGuide" %>
<%@ Import Namespace="Jayrock.Json" %>
<%@ Import Namespace="Jayrock.Json.Conversion" %>

<script runat="server">

String webLayout = "Library://UISapp/UIS/Layout/layout.WebLayout";
String defaultUser = "Anonymous";
String defaultPassword = "";
String sessionId = "";
    
</script>

try
    {
        // Initialize a session and register a variable to hold the
        // session id, then initialize the Web Extensions, connect
        // to the site, and create a session.

        InitializeWebTier();

        MgUserInformation userInfo = new MgUserInformation(defaultUser,
defaultPassword);
        MgSite site = new MgSite();
        site.Open(userInfo);
        sessionId = site.CreateSession();
    }
    catch (Exception e)
    {
        Response.Write(e.Message);
    }


    <html xmlns="http://www.w3.org/1999/xhtml" >

<head>   
</head>
<frameset rows="30,*" frameborder="no" framespacing="0">
<frame id="titleFrame" frameborder="no" marginwidth="0" marginheight="0"
scrolling="no" src="title.html">
<frame id="mapframe" frameborder="no" marginwidth="0" marginheight="0"
scrolling="no" src= "Library://UISapp/UIS/Layout/layout.WebLayout">
</frame> 
</frame>
</frameset>
</html>

The error what I am getting when i try debugging is



Server Error in '/WebSite1' 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 'InitializeWebTier' does not exist
in the current context

Source Error:

 

Line 27:         // to the site, and create a session.
Line 28: 
Line 29:         InitializeWebTier();
Line 30: 
Line 31:         MgUserInformation userInfo = new
MgUserInformation(defaultUser, defaultPassword);
 

Source File: c:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx   
Line: 29 



Show Detailed Compiler Output:


c:\Program Files\Microsoft Visual Studio 8\Common7\IDE>
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library
/utf8output /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET
Files\website1\5fd1ae96\c341d416\assembly\dl3\0986b96d\0096da11_d840c701\JAYROCK.JSON.DLL"
/R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll"
/R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\website1\5fd1ae96\c341d416\assembly\dl3\ad9baba0\00b23e22_bbaec701\MapGuideDotNetApi.DLL"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\website1\5fd1ae96\c341d416\assembly\dl3\c6d1b217\0096da11_d840c701\JAYROCK.DLL"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll"
/R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll"
/out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\website1\5fd1ae96\c341d416\App_Web_dh8rdadh.dll" /D:DEBUG /debug+
/optimize-
/win32res:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\website1\5fd1ae96\c341d416\dh8rdadh.res" /w:4 /nowarn:1659;1699;1701 
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\website1\5fd1ae96\c341d416\App_Web_dh8rdadh.0.cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\website1\5fd1ae96\c341d416\App_Web_dh8rdadh.1.cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\website1\5fd1ae96\c341d416\App_Web_dh8rdadh.2.cs"


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

c:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx(29,9):
error CS0103: The name 'InitializeWebTier' does not exist in the current
context

 



Show Complete Compilation Source:


Line 1:    #pragma checksum "C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx"
"{406ea660-64cf-4c82-b6f0-42d48172a799}" "CB4B39254C20502CAFF1FFC1695B28F9"
Line 2:   
//------------------------------------------------------------------------------
Line 3:    // <auto-generated>
Line 4:    //     This code was generated by a tool.
Line 5:    //     Runtime Version:2.0.50727.1433
Line 6:    //
Line 7:    //     Changes to this file may cause incorrect behavior and will
be lost if
Line 8:    //     the code is regenerated.
Line 9:    // </auto-generated>
Line 10:  
//------------------------------------------------------------------------------
Line 11:   
Line 12:   
Line 13:   
Line 14:   public partial class _Default :
System.Web.SessionState.IRequiresSessionState {
Line 15:       
Line 16:       protected System.Web.Profile.DefaultProfile Profile {
Line 17:           get {
Line 18:               return
((System.Web.Profile.DefaultProfile)(this.Context.Profile));
Line 19:           }
Line 20:       }
Line 21:       
Line 22:       protected System.Web.HttpApplication ApplicationInstance {
Line 23:           get {
Line 24:               return
((System.Web.HttpApplication)(this.Context.ApplicationInstance));
Line 25:           }
Line 26:       }
Line 27:   }
Line 28:   namespace ASP {
Line 29:       
Line 30:       #line 315
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
Line 31:       using System.Web;
Line 32:       
Line 33:       #line default
Line 34:       #line hidden
Line 35:       
Line 36:       #line 10 "C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx"
Line 37:       using OSGeo.MapGuide;
Line 38:       
Line 39:       #line default
Line 40:       #line hidden
Line 41:       
Line 42:       #line 316
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
Line 43:       using System.Web.Caching;
Line 44:       
Line 45:       #line default
Line 46:       #line hidden
Line 47:       
Line 48:       #line 321
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
Line 49:       using System.Web.UI.WebControls;
Line 50:       
Line 51:       #line default
Line 52:       #line hidden
Line 53:       
Line 54:       #line 318
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
Line 55:       using System.Web.Security;
Line 56:       
Line 57:       #line default
Line 58:       #line hidden
Line 59:       
Line 60:       #line 8 "C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx"
Line 61:       using System.Text;
Line 62:       
Line 63:       #line default
Line 64:       #line hidden
Line 65:       
Line 66:       #line 317
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
Line 67:       using System.Web.SessionState;
Line 68:       
Line 69:       #line default
Line 70:       #line hidden
Line 71:       
Line 72:       #line 309
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
Line 73:       using System;
Line 74:       
Line 75:       #line default
Line 76:       #line hidden
Line 77:       
Line 78:       #line 7 "C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx"
Line 79:       using System.Collections.Specialized;
Line 80:       
Line 81:       #line default
Line 82:       #line hidden
Line 83:       
Line 84:       #line 12 "C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx"
Line 85:       using Jayrock.Json.Conversion;
Line 86:       
Line 87:       #line default
Line 88:       #line hidden
Line 89:       
Line 90:       #line 320
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
Line 91:       using System.Web.UI;
Line 92:       
Line 93:       #line default
Line 94:       #line hidden
Line 95:       
Line 96:       #line 319
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
Line 97:       using System.Web.Profile;
Line 98:       
Line 99:       #line default
Line 100:      #line hidden
Line 101:      
Line 102:      #line 310
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
Line 103:      using System.Collections;
Line 104:      
Line 105:      #line default
Line 106:      #line hidden
Line 107:      
Line 108:      #line 314
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
Line 109:      using System.Text.RegularExpressions;
Line 110:      
Line 111:      #line default
Line 112:      #line hidden
Line 113:      
Line 114:      #line 11 "C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx"
Line 115:      using Jayrock.Json;
Line 116:      
Line 117:      #line default
Line 118:      #line hidden
Line 119:      
Line 120:      #line 9 "C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx"
Line 121:      using System.Globalization;
Line 122:      
Line 123:      #line default
Line 124:      #line hidden
Line 125:      
Line 126:      #line 6 "C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx"
Line 127:      using System.IO;
Line 128:      
Line 129:      #line default
Line 130:      #line hidden
Line 131:      
Line 132:      #line 322
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
Line 133:      using System.Web.UI.WebControls.WebParts;
Line 134:      
Line 135:      #line default
Line 136:      #line hidden
Line 137:      
Line 138:      #line 312
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
Line 139:      using System.Configuration;
Line 140:      
Line 141:      #line default
Line 142:      #line hidden
Line 143:      
Line 144:      #line 323
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
Line 145:      using System.Web.UI.HtmlControls;
Line 146:      
Line 147:      #line default
Line 148:      #line hidden
Line 149:      
Line 150:      
Line 151:     
[System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
Line 152:      public class default_aspx : global::_Default,
System.Web.IHttpHandler {
Line 153:          
Line 154:          private static bool @__initialized;
Line 155:          
Line 156:          private static object @__stringResource;
Line 157:          
Line 158:          private static object @__fileDependencies;
Line 159:          
Line 160:          
Line 161:          #line 14 "C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx"
Line 162:                         
Line 163:  
Line 164:  String webLayout =
"Library://Samples/Layouts/DotNetSamples.WebLayout";
Line 165:  String defaultUser = "Anonymous";
Line 166:  String defaultPassword = "";
Line 167:  String sessionId = "";
Line 168:      
Line 169:  
Line 170:          #line default
Line 171:          #line hidden
Line 172:          
Line 173:          
Line 174:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 175:          public default_aspx() {
Line 176:              string[] dependencies;
Line 177:              
Line 178:              #line 912304 "C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx.cs"
Line 179:             
((global::System.Web.UI.Page)(this)).AppRelativeVirtualPath =
"~/Default.aspx";
Line 180:              
Line 181:              #line default
Line 182:              #line hidden
Line 183:              if ((global::ASP.default_aspx. at __initialized ==
false)) {
Line 184:                  global::ASP.default_aspx. at __stringResource =
this.ReadStringResource();
Line 185:                  dependencies = new string[2];
Line 186:                  dependencies[0] = "~/Default.aspx";
Line 187:                  dependencies[1] = "~/Default.aspx.cs";
Line 188:                  global::ASP.default_aspx. at __fileDependencies =
this.GetWrappedFileDependencies(dependencies);
Line 189:                  global::ASP.default_aspx. at __initialized = true;
Line 190:              }
Line 191:              this.Server.ScriptTimeout = 30000000;
Line 192:          }
Line 193:          
Line 194:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 195:          private void @__BuildControlTree(default_aspx @__ctrl) {
Line 196:              
Line 197:              #line 1 "C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx"
Line 198:              this.InitializeCulture();
Line 199:              
Line 200:              #line default
Line 201:              #line hidden
Line 202:              @__ctrl.SetRenderMethodDelegate(new
System.Web.UI.RenderMethod(this. at __Render__control1));
Line 203:          }
Line 204:          
Line 205:          private void
@__Render__control1(System.Web.UI.HtmlTextWriter @__w, System.Web.UI.Control
parameterContainer) {
Line 206:              @__w.Write("\r\n\r\n<!DOCTYPE html PUBLIC
\"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3" +
Line 207:                     
".org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n\r\n\r\n");
Line 208:              
Line 209:              #line 22 "C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx"
Line 210:    
Line 211:  try
Line 212:      {
Line 213:          // Initialize a session and register a variable to hold
the
Line 214:          // session id, then initialize the Web Extensions,
connect
Line 215:          // to the site, and create a session.
Line 216:  
Line 217:          InitializeWebTier();
Line 218:  
Line 219:          MgUserInformation userInfo = new
MgUserInformation(defaultUser, defaultPassword);
Line 220:          MgSite site = new MgSite();
Line 221:          site.Open(userInfo);
Line 222:          sessionId = site.CreateSession();
Line 223:      }
Line 224:      catch (Exception e)
Line 225:      {
Line 226:          Response.Write(e.Message);
Line 227:      }
Line 228:       
Line 229:              
Line 230:              #line default
Line 231:              #line hidden
Line 232:              this.WriteUTF8ResourceString(@__w, 0, 428, true);
Line 233:          }
Line 234:          
Line 235:          
Line 236:          #line 912304 "C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\WebSite1\Default.aspx.cs"
Line 237:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 238:          protected override void FrameworkInitialize() {
Line 239:              base.FrameworkInitialize();
Line 240:             
this.SetStringResourcePointer(global::ASP.default_aspx. at __stringResource,
0);
Line 241:              this. at __BuildControlTree(this);
Line 242:             
this.AddWrappedFileDependencies(global::ASP.default_aspx. at __fileDependencies);
Line 243:              this.Request.ValidateInput();
Line 244:          }
Line 245:          
Line 246:          #line default
Line 247:          #line hidden
Line 248:          
Line 249:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 250:          public override int GetTypeHashCode() {
Line 251:              return 909526700;
Line 252:          }
Line 253:          
Line 254:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 255:          public override void
ProcessRequest(System.Web.HttpContext context) {
Line 256:              base.ProcessRequest(context);
Line 257:          }
Line 258:      }
Line 259:  }
Line 260:  
 



-- 
View this message in context: http://www.nabble.com/InitializeWebTier-tp15729918s16610p15729918.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list