|
-
Jul 30th, 2003, 08:09 AM
#1
Thread Starter
Addicted Member
HELP NEED: Problem in accessing a assembly from GAC .
HI
i have a problem in accessing the asembly created in GAC.
i have a code behind file which i converted to a dll and then installed in gac.
The steps which i did is :
1.converting all the business logic in to a Code Behind .vb file
2.assigning a string name to this .vb file using the sn.exe
my .vb file name is testgac.vb go created a sn name like :
sn.exe -k C:\ASP.NET\ZEN\tut\dataset\gac.snk
3.added this string name to the existing .vb file.
4.used the vbc.exe command like :
vbc.exe @vbc.rsp /t:library
c:\asp.net\zen\tut\dataset\testgac.vb /out:c:\asp.net\zen\tut\dataset\testgac
.dll /verbose
in the vbc.rsp file i just kept all the references to be added to the dll
file.
5.Used the gacutil.exe /i c:\asp.net\zen\tut\dataset\testgac.dll to place the
dll in the GAC.
til now everything was fine .
now i am using this dll in one of my aspx page.
here was my error.::
i just imported the newlly created namespace :<%@ import namespace= "gac" %>
and in one of teh click event in the aspx page i just gave onclick ="method
name " here there was en error like :::
Compiler Error Message: BC30002: Type 'gac.GACTEST' is not defined.
ok now the probable mistakes might be :
firt and formore am not using vs.net i am using notepad and compiling the
dll's.
1. the The entry in the gac is not accessible in teh aspx pape.
so must i add something else also in the aspx page??
my code:
testgac.vb
-----------
Imports system
imports system.web
imports system.web.ui
imports system.web.ui.webcontrols
Imports System.Reflection
<assembly:AssemblyKeyFile("gac.snk")>
<assembly:Assemblyversion("1.1.1.1")>
namespace gac
Public class GACTEST
Inherits System.web.UI.Page
Protected btngetname as Button
Protected btnclearname as Button
Protected lblname as Label
Public shared function getname ()as string
Return "TESTING GAC "
end Function
Public Shared function clearname () as string
Return ""
end Function
end class
end namespace
my aspx page:
------------
<%@page language="vb" %>
<%@ import namespace= "gac" %>
<script runat="server">
</script>
<form runat="server">
<asp:label id="lbltext" text="CLICK ON THE BUTTONS BELOW TO GET THE
LABEL TEXT AND TO CLEAR IT" runat="server"/>
<br><br>
<asp:label id="lblname" text="" runat="server"/>
<br><br>
<asp:button id="btngetname" text="GETNAME" Onclick ="gac.getname"
runat="server"/>
<br><br>
<asp:button id="btnclearname" text="CLEARNAME" Onclick
="gac.clearname" runat="server"/>
</form>
---------------
Help me in identifying where i went wrong???
since i am not not using VS.Net , am i misssing any references which will help in accessing the assemmbly in to the aspx pages???
,,,
senthil
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|