-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Sitaraman
Message 7 in Discussion
Hi Senthil with reference to your post/mail, u would have observed that the
error is different now. Initially it was "Compiler Error Message: BC30002: Type
'gac.GACTEST' is not defined." and now it is "Compiler Error Message: BC30456:
'getname' is not a member of 'ASP.testgac1_aspx'". In fact there is a series of
problems in the code. i copied the whole code seent by u and tried to make it work.
ill explain the errors, reasons and solution to each error step by step. The format is
Problem : Reason : Solution The Error Message is different: which means that it
cannot be a GAC Problem : To Test i tried using skipping the GAC(commented the entry
that i sent in web.config and compiled the dll to bin) and using the local bin version
only It still gace the same error "Compiler Error Message: BC30456: 'getname' is not
a member of 'ASP.testgac1_aspx' : which means that the method is not recognised :
For debugging i removed the method call I got another error in the line "Imports
gac" : which means that the namespace is not recognised : From the IIS Console, i made
this as a Web Application and this solved "Imports gac" problem To test
whether the code behind is used, i had added a page_load event handler in the code
behind, that was not getting executed : which means that the page is not associated
with (inherited from) the code behind : Added the Inherits clause in the page
directive of the aspx Page_Load got executed. So added the OnClick=gac.getname.
OnClick="gac.GetName" gave error: First of all gac is the namespaceName, calling
convention should be obj.functionname or functionname only: made it only a plain
function call OnClick="getname" Got error that "Method 'Public Function getname()
As String' does not have the same signature as delegate 'Delegate Sub
EventHandler(sender As Object, e As System.EventArgs)'.": Do understand that the Click
event handler signature should match the delegate signature as above : So added two
event handlers with the signatures
"private Sub btngetname_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btngetname.Click" and
"private Sub btnclearname_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnclearname.Click"
for the two buttons. You also need to declare the buttons in the codebehind with
"WithEvents". Remember that... Now note that the calling of the event handler is
implicit and you need not worry about writing a OnClick Event Handler. So i removed
the OnClick="getname" from ASPX AND it worked Then
i compiled the assembly again using the compile.cmd
then installed it in the GAC using the GACInstall.cmd.
I also deleted the bin version.
Added the corresponding entry in web.config
Ran the IISReset just to make sure and
loaded the page in th ebrowser.
it perfectly picks up the GAC Version
So your problem was not in the GAC but the referencing and syntax part and would not
have executed even in the local bin directory. To summarise
You need to make it as a web application
Inherit the ASPX from the CodeBehind
Create Event Handlers in the Code Behind with the Correct Signatures in the Code
behind and declare the buttons with WithEvents
That will make your program work perfectly
Im attaching the zip of the project in this post with the changed( i have changed the
names of some files for consistency). Just Copy the folder to c:\inetpub\wwwroot(it
contains all the ecessary aspx,codebehind, rsp, config and cmd files). Make it a web
application from IIS console. go to C:\Inetpub\wwwroot\gactest. Run Compile.cmd(this
will compile the dll to bin). Run GACInstall.cmd(this will reinstall the dll in GAC
AND remove the bin version) . Verify that the dll is present in gac using GACutil /l
and also that the dll is not present(deleted) in the local bin. Open the
site(http://localhost/gactest/gactest.aspx) and verify
that should solve ur problem
regards, sr btw one catch is that the PageLoad is executed twice ;). Anyone knows
why???
View Attachment(s):
http://groups.msn.com/BDotNet/_notifications.msnw?type=msg&parent=1&item=4232
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]