views:

799

answers:

4

I have an ASP.NET (2.0) site. I am on my dev box using V Studio 2008 and IIS. I have a separate User Control project that gets called from a javascript function in the default.aspx page. The User Control project is in another solution.

The application is running as expected. The user control is being called and all is well. Well not quite.

I am unable to step into the User Control project, i.e debug it. I can set breakpoints but they never get trapped. I can debug all other areas of the site both in script and code behind without any problems. The User control gets built in DEBUG to the same location as the default.aspx page.

Things i have already tried: Enabled script debugging in IE. Added the User Control project to the same web site solution Attached debugger to running instance of IE from Visual Studio Enabled debugging on the site. Built the user control in debug mode and ensured the pdb is in the same directory

Below is some sample code which should help:

default.aspx: (Cut down for brevity)

function LoadMethod() { try { LoadControl.Ping();

  }
  catch (e) //if the DLL didn't run assume there is a trust problem.
  {  
  }
 }

When i go to step into the call to LoadControl.Ping, the debugger just steps over this line of code.

Please only give feedback if you have actually done this in practice.

A: 

Code that was missing from post above:

print("<object id="LoadControl" style="width: 1px; height: 1px" classid="Nice.Inform.Client.WebLoad.dll#Nice.Inform.Client.WebLoad.LoadControl">
        <param name="ApplicationPath" value="ClientApps/NiceInform.exe" />
        <asp:Literal ID="NewCodecVersion" runat="server"></asp:Literal>
        <asp:Literal ID="CodecProductCode" runat="server"></asp:Literal>
    </object>

");

+1  A: 
  • Add the user control project to the solution you want to debug in.
  • Remove the reference you have to the user control project
  • Then set the reference of the calling project, to be the local user control project

Edit: You might also have to do a clean after you remove the reference on the second step - then check that your bin doesn't have a copy of the user control dll

qui
A: 

This is an old question, but it still googles up, so here's something that might help. This post talks about dotnetnuke modules, but I think the concept is what you were talking about - Main web project with secondary web projects that contain user controls.

Something the blog post doesn't mention: Once you've set your project to use IIS rather than webdevwebserver, and set the override URL(s), you sometimes have to do something extra to get debugging working. Right click the project -> Debug -> Start New Instance. This seems to be the only way I can reliably debug one of our usercontrol projects. Mind you, that particular project has been dragged kicking and screaming from 1.1 to 3.5, so it's probably unhappy about a few other things :-)

Dan F
A: 

Check this link

YordanGeorgiev