Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mark Olbert 87 posts 117 karma points
    Oct 17, 2009 @ 20:18
    Mark Olbert
    0

    Problems Debugging Master Page

    I'm trying to create a custom nested master page and debug it within Umbraco using VS2008. I'm hosting my development version of Umbraco on a Server 2008 machine on my local LAN.I've created post-build events to copy over the DLL, PDB, CSS and .master files that I'm working with. I can surf to a test page that uses the custom master. It displays correctly and I can interact with it (e.g., click on buttons to move to the next step of a wizard) and everything works fine when I'm not debugging the file.

    Debugging, however, is not working. I think I'm running into two separate sets of problems, one of which relates to getting VS2008 and the server to play nice with each other. For reasons known only to them, Microsoft has made coordinating things to debug ASP.NET applications complicated. I guess they just don't want people developing code with their software :). I've tried to work around that difficulty by manually attaching to the remote process running the site.

    But I also think I'm misunderstanding something on the Umbraco side. That's because when I start >>without<< debugging from within VS2008 I get the following ASP.NET error message:

    Compilation Error body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

    Server Error in '/' Application.

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

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

    Source Error:

     
    Line 2:  <asp:Content ID="Content1" ContentPlaceHolderID="bodyContentPlaceholder" runat="server">
    Line 3:      <form runat="server">
    Line 4:          <asp:Wizard runat="server" ID="wizLogin" ActiveStepIndex="0" 
    Line 5:               DisplaySideBar="False" onnextbuttonclick="wizLogin_NextButtonClick">
    Line 6:              <StepStyle CssClass="loginStepBody" />


    Source File: d:\Data\Websites\ImprovedSchoolFunding\masterpages\LoginTemplate.master    Line: 4

    The offending/missing method (wizLogin_NextButtonClick) does exist within the code-behind file for the custom masterpage:

            protected void wizLogin_NextButtonClick( object sender, WizardNavigationEventArgs e )
            {
                int i = 9;
                i++;
            }

    So I am terribly confused :).

    Tips and advice would be greatly appreciated. Also, if anyone knows of a how-to on getting VS2008 to remotely debug ASP.NET applications that mere mortals can understand I'd love to get that, too :).

    - Mark

  • Mark Olbert 87 posts 117 karma points
    Oct 17, 2009 @ 20:20
    Mark Olbert
    0

    Oops, I should have mentioned that "everything works fine without debugging, except when I add an event handler for the wizard's NextButtonClick event". That step causes the ASP.NET error I cited to appear.

    - Mark

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Oct 17, 2009 @ 23:23
    Aaron Powell
    0

    Have you got a compiled assembly (or the .CS file) on the machine & loaded into the process (ie - the DLL is in the /bin/ folder)?

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Oct 17, 2009 @ 23:24
    Morten Bock
    0

    And you are sure that your dll file is being copied to the umbraco bin folder? Look like the compiled file is not up to date.

  • Mark Olbert 87 posts 117 karma points
    Oct 18, 2009 @ 00:47
    Mark Olbert
    0

    Thanks to both of you for getting back to me. It turns out I had a typo in the post-build macro which was copying the DLL and PDB files to the wrong location. But as I'd done the first few iterations manually, there was an outdated file in the bin directory. Naturally it didn't work as I began to add functionality to the master page.

    BTW, getting remote debug to work, sort of, involved an arcane issue. First off, you have to have MSVSMON.EXE running on the server (that was relatively easy to figure out). But -- and this I would never have guessed in a million years -- you have to leave the IP address for a site you're going to debug set to "all unassigned". If you specify a particular IP address the debugger won't be able to locate the site. Which is really, really, weird, IMHO, but definitely a factor in the solution.

    - Mark

Please Sign in or register to post replies

Write your reply to:

Draft