how to debug dll written in C# in ASP.NET project

hi,

actually this dll is a windows form control hosted in Internet Explorer written in C#.In my asp.net project i called this dll in an aspx page.

I already defined the "start page" for the dll project to be that aspx page,but i can still not debug the dll. Could someone give me some hint

thanks a lot



Answer this question

how to debug dll written in C# in ASP.NET project

  • Alexkobe

    First, perhaps I am betraying my ignorance here, but .ascx files are a server-side file. This thread and these instructions are about debugging client-side managed code. Are you interested in debugging client side managed code

    Recardless, this error:

    Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information. Click help for more information."

    Indicates a problem trying to debug the server. If you are trying to debug client side code, you can just uncheck the 'ASP.NET' checkbox.

    If you want to debug server-side:

    1. Can you succefully start debugging before you configured 'Start External Program'
    2. What version of Windows
    3. The debugger will save a log of the response from IIS in %tmp%\Visual Studio Web Debugger.log. Please include this.



  • bigboyc

    Try this:

    1) Ctrl-F5 your project. Steal the IE URL from IE's address bar

    2) Go into project properties. Switch the start action from 'Use current page' to 'Start external program'.

    Program=c:\Program Files\Internet Explorer\IEXPLORE.EXE

    Command Line arguments=-nohome http://localhost:22738/WebSite1/

    Where use the URL that you got it step #1 instead of my example URL

    3) F5

    Let me know if this works for you.



  • itisasif

    I just tried this, but I'm getting "Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information. Click help for more information."

    I usually manually attach the ASP.NET debugger to my running process in the app that calls the dll, but when I try to attach to the project for my dll instead of to the main app, I get an error: "The following module was built either with optimizations enabled or without debug information...".

    When I attach to my main app of course, I can't set a breakpoint in the dll...

    The active configuration for the solution AND the Build property of ALL the projects in the solution is Debug.

    Debug is set to true in Web.config.

    Project Properties web screen has been changed from UseCurrentPage to

    StartExternalProgram with

    Program=c:\Program Files\Internet Explorer\IEXPLORE.EXE

    Command Line arguments=-nohome <myASPAppLocalhostURL>

    DLL code is included as codebehind for an .ascx control that exists in both projects (included assembly's namespace is referenced for codebehind in the .ascx in the main ASP.NET project)

    What am I missing

    Thanks!


  • polonius

    thanks for your reply.

    It works. But if I want to jumps from the ASP.NET project to .dll project, i dont find the way. 

    More clearly, I have set the breakpoint where the dll is called in the ASP.NET project, and also breakpoint in the dll project. Now i start ASP.NET project, the program will not trace into the dll project.

    Because my dll is a user control, without being bound to the ASP.NET

    project, there shows some security exception.  that bothers me.

     what would you debug in my situation

    thanks

     


  • how to debug dll written in C# in ASP.NET project