locked
Why am I getting, "'AnnuallyPage' does not contain a definition for 'ConvertButton' and no extension method 'ConvertButton'"? RRS feed

  • Question

  • Earlier I had a problem which I posted here The .appxupload isn't being created, could it be related to a "does not contain a definition for..." error? I've got help on that. But I still am unable to create an app package so I can submit an update to my Store App. But now I'm getting what I can only describe as ghost error messages. I've got 12 of them, that basically look like this:

    Error CS1061 'AnnuallyPage' does not contain a definition for 'ConvertButton' and no extension method 'ConvertButton' accepting a first argument of type 'AnnuallyPage' could be found (are you missing a using directive or an assembly reference?)Error 
    CS1061 'AnnuallyPage' does not contain a definition for 'ConvertButton_Click' and no extension method 'ConvertButton_Click' accepting a first argument of type 'AnnuallyPage' could be found (are you missing a using directive or an assembly reference?)

    I simply do not get this. Yes, in the past, when I posted the question I linked to above, I did have a button named ConvertButton and an event named ConvertButton_Click in the code behind of 6 pages, of which AnnuallyPage is one of them. But just as the answer given to my question suggested I removed the buttons and events, I have done exactly that in all 6 pages!

    I have completely removed any definition of ConvertButton in the XAML files. It doesn't even exist in commented out code. It literally is not there.

    I have completely removed any definition of ConvertButton_Click in all .cs files. It doesn't even exist in commented out code. Again, it literally is not there.

    I have searched, using Find in Files the string "ConvertButton" in the project. It cannot be found anywhere. I have done this multiple times.

    I have searched, using Find in Files the string "ConvertButton" in the solution. It cannot be found anywhere. I have done this multiple times.

    I have cleaned the project multiple times.

    I have cleaned the solution multiple times.

    I have gotten out of VS 2017, then gotten back in multiple times!

    PLEASE, someone explain to me why VS 2017 insists that something is there WHEN IT ISN'T! It is impossible for me to fix what doesn't exist.


    Rod

    Saturday, July 21, 2018 1:45 PM

Answers

  • I found an answer. According to this post on Stack Overflow I had to delete the bin and obj folders. So, I got out of VS, deleted both of those folder, got back in again and everything's right as rain. But really, I expected that cleaning either the project or the solution would have cleared out both of those. Makes me wonder what in heck Project | Clean does? Seems more like a placebo, rather than something that actually performs a function. The problem was there were *.g.cs files, from months ago, in the obj folder, that had code with "ConvertButton" in them. Not at all helpful.


    Rod

    • Marked as answer by Doctor-Who Sunday, July 22, 2018 12:08 AM
    Sunday, July 22, 2018 12:08 AM

All replies

  • I found an answer. According to this post on Stack Overflow I had to delete the bin and obj folders. So, I got out of VS, deleted both of those folder, got back in again and everything's right as rain. But really, I expected that cleaning either the project or the solution would have cleared out both of those. Makes me wonder what in heck Project | Clean does? Seems more like a placebo, rather than something that actually performs a function. The problem was there were *.g.cs files, from months ago, in the obj folder, that had code with "ConvertButton" in them. Not at all helpful.


    Rod

    • Marked as answer by Doctor-Who Sunday, July 22, 2018 12:08 AM
    Sunday, July 22, 2018 12:08 AM
  • Hi Rod

    Thanks for sharing your solution here.

    Daisy


    MSDN Community Support
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 10, 2018 9:13 AM