jpbivona
asked on
Use a VB.NET class from a classic ASP page
I am trying to create a very simple VB.net Class Library, compile it into a dll, and use its function in an asp page. I am following the following examples:
http://weblogs.asp.net/dneimke/archive/2004/01/31/65330.aspx
http://www.codeproject.com/useritems/dotnetcomponentandasp.asp
MY PROBLEMS:
1) I cannot see it in my registry after compiling and running RegASM /tlb /codebase
2) My asp page code gives an error:
Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid class string
/sar/test.asp, line 7
MY VB CLASS CODE: (Project - MyClass)
Imports System.EnterpriseServices
Imports System.Runtime.InteropServ ices
Public Class Class1
Public Function Print(ByRef Text As String) As String
Return Text
End Function
End Class
MY ASP PAGE CODE:
Dim Obj
Set Obj = Server.CreateObject("MyCla ss.Class1" )
Response.write Obj.Print("Jeremy")
ASSEMBLY CODE: (AssemblyInfo.vb)
Imports System
Imports System.Reflection
Imports System.EnterpriseServices
Imports System.Runtime.InteropServ ices
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("MyClass")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("MyClass") >
<Assembly: AssemblyCopyright("Copyrig ht © 2007")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyKeyFile("C:\MyClas s.snk")>
<Assembly: ComVisible(False)>
<Assembly: ApplicationName("MyClass") >
<Assembly: ApplicationActivation(Acti vationOpti on.Server) >
<Assembly: ApplicationAccessControl(F alse, AccessChecksLevel:=AccessC hecksLevel Option.App licationCo mponent)>
I have created a strong name for this build.
Can someone please help?
http://weblogs.asp.net/dneimke/archive/2004/01/31/65330.aspx
http://www.codeproject.com/useritems/dotnetcomponentandasp.asp
MY PROBLEMS:
1) I cannot see it in my registry after compiling and running RegASM /tlb /codebase
2) My asp page code gives an error:
Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid class string
/sar/test.asp, line 7
MY VB CLASS CODE: (Project - MyClass)
Imports System.EnterpriseServices
Imports System.Runtime.InteropServ
Public Class Class1
Public Function Print(ByRef Text As String) As String
Return Text
End Function
End Class
MY ASP PAGE CODE:
Dim Obj
Set Obj = Server.CreateObject("MyCla
Response.write Obj.Print("Jeremy")
ASSEMBLY CODE: (AssemblyInfo.vb)
Imports System
Imports System.Reflection
Imports System.EnterpriseServices
Imports System.Runtime.InteropServ
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("MyClass")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("MyClass")
<Assembly: AssemblyCopyright("Copyrig
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyKeyFile("C:\MyClas
<Assembly: ComVisible(False)>
<Assembly: ApplicationName("MyClass")
<Assembly: ApplicationActivation(Acti
<Assembly: ApplicationAccessControl(F
I have created a strong name for this build.
Can someone please help?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.