Hi Tiraman,
I am sorry for confusion, after I further test I know that in compile time
the path property of the assembly in the reference may not be pointed to
the GAC.
From you description, you are not using codebehind.
So I think when you import namespace in the aspx page, you may try to
declare the @ assembly and @ Import directives. And if you do not use the
codebehind page, you may not need to add reference to the dll in the
solution explorer.
Here is the code you may have a test.
[Note: if you are reference an assembly in the GAC, please do use the full
qualified name, not just the assembly name]
[WebVorm1.aspx]
<%@ Page Language="vb"%>
<%@ Import Namespace="TestCls"%>
<%@ Assembly Name=" TestCls1, Version=1.0.1559.32193, Culture=neutral,
PublicKeyToken=9f907b2880e0c3fd, Custom=null" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="
http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">
<%
Dim o as new TestABC
Response.Write(o.Hello())
%>
<form id="Form1" method="post" runat="server">
</form>
</body>
</html>
[TestCls1.dll]
[Note: the Rootnamespace is TestCls]
Public Class TestABC
Public tls As ArrayList
Public tls2 As ArrayList
Public Shared Function Hello() As String
Return "Hello World"
End Function
End Class
After I add the assembly into the GAC, I will run the webapplication with
deleting the TestCls1.dll in all the places except the GAC, because the CLR
runtime will probe the assembly in the GAC.
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.