Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.net CS1061 Compilation Error on deployment

Tags:

c#

asp.net

iis

I'm having a bit of a pain here and I just can't figure out what's wrong.

I have an ASP.net project which I deployed on a server. At first everything seemed allright, no Errors whatsoever. However, as a last adition I wanted to add a search function to a fairly large list so I added the following syntax to my mark-up:

<td>
    Search Server:
    <asp:TextBox ID="txtSearch" runat="server" />
    <asp:Button ID="btnLookup" runat="server" OnClick="btnLookup_Clicked" Text="Search" />
    <asp:Label ID="lblFeedback" runat="server" />
</td>

and the following in code behind:

protected void btnLookup_Clicked(object sender, EventArgs e)
{
    lblFeedback.Text = "";
    Session["IsSearch"] = true;
    LoadServerList();
}

When I run this locally it works just fine as I expect. HOWEVER!

When I copy these files to the server I get a compilation error:

Compiler Error Message: CS1061: ' ASP.ntservice_ reports_ reports_ serverlist_ manage_ aspx ' does not contain a definition for 'btnLookup_ Clicked' and no extension method 'btnLookup_ Clicked' accepting a first argument of type 'ASP.ntservice_ reports_ reports_ serverlist_ manage_ aspx' could be found (are you missing a using directive or an assembly reference?)

it says there is nothing that handles my Clicked event although it does work when I run it through Visual studio.

any ideas?

EDIT: What I tried myself is

  • renaming button
  • deleting and readding the button
  • add through designer
  • renaming click event
  • removing the event from markup allows normal execution ... :/
like image 821
Jan W. Avatar asked Jul 29 '09 06:07

Jan W.


1 Answers

Is your project a web site or a web application? I would guess that it's a web application project and that perhaps you don't have the latest DLL deployed from the bin folder. Check the versions between your machine and the server to verify that they are the same.

like image 126
Randy supports Monica Avatar answered Sep 28 '22 02:09

Randy supports Monica