I have an older asp.net application that when installed at the client runs at one site and does not at others.
The application is written in asp.net 2.0 vb. The application does not use Visual Studio. I create a directory/website under and copy the 4 files:
test_inline.ASPX
Mycomponents.vb
MyPage.vb
BIN\Mycomponents.DLL
If I run the program using the Cassini Web Server, the program runs with no error. When I run under IIS I get the error:
Namespace or type 'Mycomponents' cannot be found.
I compile the file Mycomponents.vb and copy the file Mycomponents.dll into the BIN directory.
tHIS EXAMPLE USES 3 FILES
FILE #1: test_inline.ASPX
<%@ Page Language="VB" Inherits="MyPage" Src="MyPage.vb" Debug="TRUE" AspCompat="FALSE" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>
<%@ import Namespace="MyComponents" %>
<script runat="server">
PUBLIC oApp AS New MyObject
Sub Page_Load
lblHellow.text = "This is a test"
END SUB
</script>
<html>
File#2: MyPage.vb
' MyPage.vb
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HTMLControls
Imports System.Data
Imports System.Data.OleDb
Imports MyComponents
Public Class MyPage
Inherits Page
PUBLIC connection_string AS STRING
Overridable Sub Page_Load()
connection_string = ""
End Sub
End Class
file#3:mycomponents.vb
' MyComponents.vb
'
Imports System
Imports System.Data
Imports System.Data.Common
Imports System.Data.OleDb
Imports System.Data.SqlClient
Imports System.Web
Namespace MyComponents
Public Class MyObject
Public strSQL AS STRING
end class
End Namespace
The application is written in asp.net 2.0 vb. The application does not use Visual Studio. I create a directory/website under and copy the 4 files:
test_inline.ASPX
Mycomponents.vb
MyPage.vb
BIN\Mycomponents.DLL
If I run the program using the Cassini Web Server, the program runs with no error. When I run under IIS I get the error:
Namespace or type 'Mycomponents' cannot be found.
I compile the file Mycomponents.vb and copy the file Mycomponents.dll into the BIN directory.
tHIS EXAMPLE USES 3 FILES
FILE #1: test_inline.ASPX
<%@ Page Language="VB" Inherits="MyPage" Src="MyPage.vb" Debug="TRUE" AspCompat="FALSE" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>
<%@ import Namespace="MyComponents" %>
<script runat="server">
PUBLIC oApp AS New MyObject
Sub Page_Load
lblHellow.text = "This is a test"
END SUB
</script>
<html>
File#2: MyPage.vb
' MyPage.vb
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HTMLControls
Imports System.Data
Imports System.Data.OleDb
Imports MyComponents
Public Class MyPage
Inherits Page
PUBLIC connection_string AS STRING
Overridable Sub Page_Load()
connection_string = ""
End Sub
End Class
file#3:mycomponents.vb
' MyComponents.vb
'
Imports System
Imports System.Data
Imports System.Data.Common
Imports System.Data.OleDb
Imports System.Data.SqlClient
Imports System.Web
Namespace MyComponents
Public Class MyObject
Public strSQL AS STRING
end class
End Namespace