need urgent help to deebug a process

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony Johansson

    need urgent help to deebug a process

    Hello!

    We have a C#.ASP.NET web application that runs on a IIS 6. The application
    contains actually several asp pages but there is no GUI.
    The application receive an xml file that is processed.
    There is also an MFC dll that is called from this asp application to make a
    syntax check on quite many commands.
    You don't have to know what a command is.

    The problem that we get is the following when the asp pages calls the MFC
    dll it will run into protected memory error.
    The IIS runs on a windows server 2003.
    We have also added some rows in the MFC dll to write to a file about where
    in the
    dll it is executing and also write some value for different variables.

    We have also build the dll in debug mode and copied it to the windows server
    2003 and it will result in the same protected memory error.

    Another thing that is of interest is that if we run the built-in application
    server in Visual Studio which exist by default we never get any kind of
    error. Note I don't mean IIS here.

    This is strange because when we run the built-in application server the asp
    will call the MFC dll but when we run it in this way we never get any
    kind of problem.

    We have also copied and change the asp pages to be runable in a windows form
    application which will call the
    MFC dll and here we never get any kind of problem either.

    Another very strange thing is that when we add statements to write to a file
    it might cause the application to work.

    So if we have for example 10 statement to write to a file in
    the MFC DLL we get protected memory but if we then
    add some more statement to write to a file it might cause the application to
    work
    and NOT cause any protected memeory.

    I hope to get some information about this strange problem that we have.
    For example I wonder about the row that cause the crash.
    As I said before it sounds strange that there should be an error on that row
    when it works when we run and call the MFC dll in two different local modes
    which are.
    1. Use Visual Studio and the built-in application server
    2. Use Windows forms that call the MFC dll

    I have now installed the local IIS.

    What I want to do is debug the process that is calling the MFC DLL is that
    possible?
    Can somebody explain the steps that need to be done if I want to debug the
    MFC dll
    from within VS.


    //Tony


  • Anthony Jones

    #2
    Re: need urgent help to deebug a process



    "Tony Johansson" <t.johansson@lo gica.comwrote in message
    news:eZekr8oPJH A.1384@TK2MSFTN GP03.phx.gbl...
    Hello!
    >
    We have a C#.ASP.NET web application that runs on a IIS 6. The application
    contains actually several asp pages but there is no GUI.
    The application receive an xml file that is processed.
    There is also an MFC dll that is called from this asp application to make
    a
    syntax check on quite many commands.
    You don't have to know what a command is.
    >
    The problem that we get is the following when the asp pages calls the MFC
    dll it will run into protected memory error.
    The IIS runs on a windows server 2003.
    We have also added some rows in the MFC dll to write to a file about where
    in the
    dll it is executing and also write some value for different variables.
    >
    We have also build the dll in debug mode and copied it to the windows
    server
    2003 and it will result in the same protected memory error.
    >
    Another thing that is of interest is that if we run the built-in
    application
    server in Visual Studio which exist by default we never get any kind of
    error. Note I don't mean IIS here.
    >
    This is strange because when we run the built-in application server the
    asp
    will call the MFC dll but when we run it in this way we never get any
    kind of problem.
    >
    We have also copied and change the asp pages to be runable in a windows
    form
    application which will call the
    MFC dll and here we never get any kind of problem either.
    >
    Another very strange thing is that when we add statements to write to a
    file
    it might cause the application to work.
    >
    So if we have for example 10 statement to write to a file in
    the MFC DLL we get protected memory but if we then
    add some more statement to write to a file it might cause the application
    to work
    and NOT cause any protected memeory.
    >
    I hope to get some information about this strange problem that we have.
    For example I wonder about the row that cause the crash.
    As I said before it sounds strange that there should be an error on that
    row
    when it works when we run and call the MFC dll in two different local
    modes
    which are.
    1. Use Visual Studio and the built-in application server
    2. Use Windows forms that call the MFC dll
    >
    I have now installed the local IIS.
    >
    What I want to do is debug the process that is calling the MFC DLL is that
    possible?
    Can somebody explain the steps that need to be done if I want to debug the
    MFC dll
    from within VS.
    >
    Not sure what this has to do with C# however...

    You've got the MFC project on your local machine and the website also so.
    Build a debug version of the project and have the web app use that dll from
    its build location. In VS with the project loaded attach native debugging
    to the w3wp.exe process that represents your web app. Now you can set break
    points in your MFC code to trace through what is happening.

    --
    Anthony Jones - MVP ASP/ASP.NET

    Comment

    • Tony Johansson

      #3
      Re: need urgent help to deebug a process

      Hello!

      So you mean I first start the asp.net web application from my local IIS
      which is from within VS.
      I just wonder at what point do I attach to the process w3wp you meantioned
      in your main

      //Tony


      "Anthony Jones" <AnthonyWJones@ yadayadayada.co mwrote in message
      news:uvK4nQpPJH A.4084@TK2MSFTN GP04.phx.gbl...
      >
      >
      "Tony Johansson" <t.johansson@lo gica.comwrote in message
      news:eZekr8oPJH A.1384@TK2MSFTN GP03.phx.gbl...
      >Hello!
      >>
      >We have a C#.ASP.NET web application that runs on a IIS 6. The
      >application
      >contains actually several asp pages but there is no GUI.
      >The application receive an xml file that is processed.
      >There is also an MFC dll that is called from this asp application to make
      >a
      >syntax check on quite many commands.
      >You don't have to know what a command is.
      >>
      >The problem that we get is the following when the asp pages calls the MFC
      >dll it will run into protected memory error.
      >The IIS runs on a windows server 2003.
      >We have also added some rows in the MFC dll to write to a file about
      >where in the
      >dll it is executing and also write some value for different variables.
      >>
      >We have also build the dll in debug mode and copied it to the windows
      >server
      >2003 and it will result in the same protected memory error.
      >>
      >Another thing that is of interest is that if we run the built-in
      >application
      >server in Visual Studio which exist by default we never get any kind of
      >error. Note I don't mean IIS here.
      >>
      >This is strange because when we run the built-in application server the
      >asp
      >will call the MFC dll but when we run it in this way we never get any
      >kind of problem.
      >>
      >We have also copied and change the asp pages to be runable in a windows
      >form
      >application which will call the
      >MFC dll and here we never get any kind of problem either.
      >>
      >Another very strange thing is that when we add statements to write to a
      >file
      >it might cause the application to work.
      >>
      >So if we have for example 10 statement to write to a file in
      >the MFC DLL we get protected memory but if we then
      >add some more statement to write to a file it might cause the application
      >to work
      >and NOT cause any protected memeory.
      >>
      >I hope to get some information about this strange problem that we have.
      >For example I wonder about the row that cause the crash.
      >As I said before it sounds strange that there should be an error on that
      >row
      >when it works when we run and call the MFC dll in two different local
      >modes
      >which are.
      >1. Use Visual Studio and the built-in application server
      >2. Use Windows forms that call the MFC dll
      >>
      >I have now installed the local IIS.
      >>
      >What I want to do is debug the process that is calling the MFC DLL is
      >that possible?
      >Can somebody explain the steps that need to be done if I want to debug
      >the MFC dll
      >from within VS.
      >>
      >
      Not sure what this has to do with C# however...
      >
      You've got the MFC project on your local machine and the website also so.
      Build a debug version of the project and have the web app use that dll
      from its build location. In VS with the project loaded attach native
      debugging to the w3wp.exe process that represents your web app. Now you
      can set break points in your MFC code to trace through what is happening.
      >
      --
      Anthony Jones - MVP ASP/ASP.NET
      >

      Comment

      • Anthony Jones

        #4
        Re: need urgent help to deebug a process

        "Tony Johansson" <t.johansson@lo gica.comwrote in message
        news:Od0HvkpPJH A.3596@TK2MSFTN GP06.phx.gbl...
        Hello!
        >
        So you mean I first start the asp.net web application from my local IIS
        which is from within VS.
        I just wonder at what point do I attach to the process w3wp you meantioned
        in your main
        >
        Yes you'll need to make at least one request into the app to get it spun up.
        If you are using XP its not called w3wp.exe it will called aspnet_wp.exe in
        which case you need to make at least one request that invokes a .NET handler
        such as an aspx or ashx request.


        --
        Anthony Jones - MVP ASP/ASP.NET

        Comment

        Working...