Hi all,
I have ported a COM+ written in VB 6.0 to run in ASP.NET 3.5 and am attempting to debug locally --
My client is an ASP.NET application-- the target client will actually be a classic ASP application, but we aren't allowed to run IIS on our development machines, so I'm just trying to get the code to work with ASP.NET for now.
When I step into the code I notice that an ObjectContext is returned by GetObjectContext however its items collection is empty (the Count property's value for the returned ObjectContext is zero).
Here's the code segment --
Imports System.Data.Sql
Imports System.Data.SqlClient
Imports System.Text
Imports System.Runtime.InteropServices
Imports System.EnterpriseServices
Imports COMSVCSLib
Imports System.Web
Imports System.Web.SessionState
Imports ASPTypeLibrary
<Assembly: ApplicationActivation(ActivationOption.Server)> _
<Assembly: ApplicationAccessControl(False, AccessChecksLevel:=AccessChecksLevelOption.ApplicationComponent)>
Public Class COMClass
Inherits ServicedComponent
Public Sub TestMethodObjectCtxt()
Dim objContext As ObjectContext
Dim objResponse As Response
Dim objRequest As Request
Dim objApplication As Application
Dim objSession As Session
Dim objAppServer = New AppServer
objContext = objAppServer.GetObjectContext()
objApplication = objContext("Application") ' Obtain ASP
Application object.
objSession = objContext("Session") ' Obtain ASP Session
object.
objResponse = objContext("Response") ' Obtain ASP Response
object.
objRequest = objContext("Request") ' Obtain ASP Request
object.
'This code uses the Response object (objResponse).
'You can use other intrinsic objects in a similar fashion.
If Not objResponse Is Nothing Then
objResponse.Write("Hello World!")
End If
End Sub