none
VS2010 WebSite project - no symbols loaded

    Question

  • Hi Folks,

    I have a VS2010 .Net 4 Website project (not web appliction) that I am trying to debug by attaching the debugger to IIS7 (on my machine). When I set a breakpoint I get the messsage that the breakpoint wont be hit as no symbols have been loaded for the document.

    If I hit F5 and debug in visual studio, I can set breakpoints and I can see in the output that is has loaded symbols, however as I need to run the application under an identity account I need to debug the application in IIS.

    I have debug=true in the web config and the application is built using the debug config. 

    Does anyone have an idea why this issue would occur?

    Regards.

    Wednesday, November 16, 2011 7:45 PM

Answers

  • I'll mark this as the answer but I have not yet fully tested it as a solution.

    In the web.config I have added the 'optimizeCompilations='false'  to the <compilation debug='true' line.   I noticed that when I was looking at the modeuls <ctrl-alt-U> that the 'optimized' setting was set to true for the modules that were not having their symbols loaded correctly.

    • Marked as answer by AndyW2007 Monday, December 19, 2011 3:06 AM
    Monday, December 19, 2011 3:06 AM
  • I've been going through the wringer on this trying to get symbols to load on my asp.net site on my local IIS using VS2010 remote debugger.

    I had set a symbol path to my apps \bin folder where the files were. I had checked the option to use Microsoft Symbol servers.

    I had checked the Emit Debug Info option when publishing.

    Still no symbols.

    I finally got desperate and started playing with debug options (from the Debug menu). I had "Enable Just My Code" checked and "Enable .NET Framework source stepping" NOT checked. I'm assuming these were defaults.

    Just as an experiment, I checked "Enable .NET Framework source stepping" which automatically unchecked "Enable Just My Code".

    Immediately I saw messages in the status line at the bottom of the VS main window telling me it was loading symbol files (I was currently debugging so the effect was immediate).

    Now I can create breakpoints and they work!!

    This is the first time since I've had VS2010 (I got it when it first RTM'd on MSDN) that I can actually remote debug anything successfully.

    Hope this helps someone!!

    I also made sure the remote debugger was running as administrator by the way (I'm not using it as a service).
    Friday, April 20, 2012 7:53 PM

All replies

  • Maybe the host web site way is the root cause in this case, please try this way to host your web project to the local IIS, though it is a WCF document, but it will work for you when you use a asp.net project:

    http://msdn.microsoft.com/en-us/library/aa751792.aspx

     

    Using Visual Studio 2010 to Host a WCF Service on the Local IIS Instance

    Open or create a WCF Service Application project. Right click the project in the solution explorer and select Properties. In the project properties window select the Web tab on the left hand side of the window. On the right hand side of the window, underServers, select the Use Local IIS Web Server and type in a URL. Next, click the Create Virtual Directory button and build the solution. This will create the virtual directory in IIS and map it to your project directory. The service will then be hosted on the local IIS server for building and debugging purposes. To verify the service has been hosted, open Internet Explorer and type the service’s URL in the address box. You must type in the complete URL path to the .svc file. For example, with a default WCF Service Application project hosted under http://localhost/MyFirstService the complete URL would be http://localhost/MyFirstService/Service1.svc. This will display the default WCF Service page.

    If it cannot work for you, then you can try this:

    http://stackoverflow.com/questions/210250/how-do-i-attach-the-debugger-to-iis-instead-of-asp-net-development-server

    1. The idea is to compile your code using VS 2010 ( seehttp://blogs.objectsharp.com/cs/blogs/steve/archive/2010/09/13/modifying-and-securing-the-adfs-2-web-application.aspx)
    2. Copy over the code to inetpub\ADFS\ls.
    3. Open a VS 2010 project in inetpub\ADFS\ls.
    4. Set the project properties -> web tab to 
    5. Attach to Process in your debugger to w3wp.exe
    6. Set you breakpoints in Global.asax.cs .
    7. Open the browser and use the url  to your ADFS server.
    8. This works for me.


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    Thursday, November 17, 2011 2:33 AM
    Moderator
  • I am writing to check the status of the issue on your side. 
    What about this problem now? 
    Would you mind letting us know the result of the suggestions?

    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    Saturday, November 19, 2011 11:34 AM
    Moderator
  • Hi Mike,

    Unfortunately neither of the two options appear to work for me. I am working with a WebSite project so the property pages are different. Also I need to be able to run the site under an Identity account.

    I have noticed that when I attach the debugger to IIS, I can see that when it loads the files from the Temporary ASP.Net Files\Root\.... directory it shows the following:-

        App_Web_abcdef.dll Symbols Loaded   but on the next line
        xyz\assembly\....\App_Web_defhig.dll  Skipped loading symbols module is optimised and the debugger option 'Just my code' is enabled

     

    When I press F5 and attempt to debug locally, I do not see the second line.

    Regards

    Andy

    Sunday, November 20, 2011 8:42 PM
  • 1. New Web Site...

    2. Drag a button to the page, and double click on it to generate the Button1_Click click event handler method.

    3. Set a breakpoint at the beginning of Button1_Click method.

    4.

    5. Open your IIS config manager, and start the "Default Web Site", then add a Application, and point the path to the project root path.

    6. Switch to Visual Studio 2010, and press "F5", it open the page in the Browser, it hit the breakpoint after I click on Button1.

    https://skydrive.live.com/embedicon.aspx/2011/2011Y11M/WebSite2.zip?cid=bb789f72272d4858&sc=photos

    Can you help me to test it in your side, and let me know if you can hit the breakpoint in your side through this demo?

    If there's any concern, please feel free to let me know.

    Best wishes,


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    Monday, November 21, 2011 5:20 AM
    Moderator
  • Hi Mike,

    Using the above I get "unable to start debugging on the web server. The web server could not find the requested resource".

    For some further testing, this is what I did.

    Test one:  Create a new website in VS2010, left all settings alone, added button to page, set the breakpoint on the click handler, press F5 and can hit the breakpoint.  - The start options were not changed from default and were set to 'use default web server.

    Test Two:  Using IIS7, create a new app pool with a unique port number, create a new web site and assign to the app pool.  Set the location of the website directory to point to the site created in step 1.  Browse the website to load into the web browser.  In VS2010, attach the debugger to the website (w3wp) process.  I was able to set a breakpoint and hit it when the button was pressed.

    Test Three:  Create a new directory to publish the website to. In IIS, modify the website created in test two so that it points to the new publish directory.  Using VS2010, publish (using Publish Web Site) the website to IIS.  Browse the site so that it is loaded into the web browser, attach the debugger.  This time I was unable to set a breakpoint and symbols were not loaded.

    I am thinking that something during the publish process is not being set/copied across to the new site.

    Regards

    Andy

     

    • Edited by AndyW2007 Tuesday, November 22, 2011 2:16 AM
    Tuesday, November 22, 2011 2:14 AM
  • Oh, you mean debug a published Web site project, I thought you want debug the Web site project which hosted on IIS only, they're different, but only one option can let us debug it after we published it.

    I think the root cause is you have not select Emit debug information when you publish the Web site project through your Visual Studio:

    I used the Visual Studio publish to web site project to the IIS directly, instead of create application and point the directory to our publish folder like what you did in the "Test Two".

    We need to use Administrator boot the Visual Studio.

    Create the new named WebSite41 application in the local IIS.

    And then config the project Start Options:

    For more detail you can ref these two tutorials:

    http://msdn.microsoft.com/en-us/library/20yh9f1b.aspx

    http://blogs.msdn.com/b/sudeepg/archive/2007/08/13/why-the-debugger-will-not-hit-your-breakpoints.aspx

    If there's any concern, please feel free to let me know.

    Best wishes,


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    Tuesday, November 22, 2011 7:12 AM
    Moderator
  • Hi Mike,

    Sorry, neither of these options has worked.   It has still not loading the symbols for app_web.abcd.dll claiming that the module is optimised and 'just my code' is selected.

    Also, when I try and use the custom options setting I just get an error 'the web server could not find the requested resource'.

    I am running visual studio as administrator

    Wednesday, November 23, 2011 10:05 PM
  • Base on my test, the error "the web server could not find the requested resource" will popup to you if you have not boot the server, have you ensured this after you open the IIS Manager?

    And first, I hope we can do not pay more attention on the app_web.abcd.dll, the goal is debug into your source code, make it hit the breakpoint, right?

    The steps in the above post is what I find in my tests, it can work. So I would like you to help me ensure that you follow it tested, maybe there's something lost when you read the steps, I hope you can help me follow the steps do a test again, and then let me know the result if you can hit the breakpoint.

    Please use my this demo project to do the test in your side: https://skydrive.live.com/embedicon.aspx/2011/2011Y11M/WebSite3.zip?cid=bb789f72272d4858

    If there's any concern, please feel free to let me know.

    Best wishes,


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    Thursday, November 24, 2011 6:45 AM
    Moderator
  • Hi,

    I have followed the steps, it does not work for me.   Have you tried reproducing my error as per my steps above - especially step 3? 

    b.t.w  I was a little confused by the term 'boot the web server'. Are you meaning to browse the web site so that it is compiled and there is an active process to debug. If so, then the answer is yes.

    Have used your source as well.

    Thursday, November 24, 2011 9:21 PM
  • I don't know why, it always show me that it have not permission to write files to here:

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root

    I solved this problem at first time, but when I do a new test, the problem keeps there, even though I tried the solution what found form internet.

    So I just change the application pool for this new web site to the "Default Application Pool", then browse the web site once, let it generate the symbol(publish with "Emit debug information no symbol", also used my steps in my above posts.)

    When it can be browse, opened the temp folder:

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\...\...

    I can see the libraries and symbols are generated, so I then change the web site's application pool to testApplicationPool(what I created and used to test before as your step2 told).

    Then I can load the libraries and symbols when I use the debugger attach to the w3wp.exe(please ensure the username is your application pool name, if you attach to the wrong process with wrong application pool name, it will not load the libraries and symbols).

    Modules window(Ctrl+Alt+U): Debug->Windows->Modules at debugging time.

    About the IIS configuration and the web site project compile at runtime problem, I'm not a expert, so please use the asp.net forum if you want research that problem. But for the debugging problem's test result is here.

    If there's any concern, please feel free to let me know.

    Best wishes,


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Friday, November 25, 2011 6:17 AM
    Moderator
  • I am writing to check the status of the issue on your side. 
    What about this problem now? 
    Would you mind letting us know the result of the suggestions?

    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    Monday, November 28, 2011 7:54 AM
    Moderator
  • Hi Mike,

    Apologies for the delay in replying.

    In the screens you show above, on the publish website - I have no 'Emit debug information' checkbox. Otherwise the dialog is the same.

    When I check the modules (Ctrl-Alt-U) I can see most of the assemblies are marked as 'Skipped loading'.  Hower, 3 of the files (app_web_????.dll) are marked as symbols loaded.  The symbol path points to PDB files in the  "...\Temp ASP.NET Files\root..." directory and the files are marked as 'not optimised'.

    However, there are also three files with rougly the same name (app_web_yyyy.dll which are in the assembly directory one level deeper than the first three files, and these are marked as optimised with 'no symbols loaded'.

    I also notice there is a file with a random name which shows up with no path and is marked with 'No Symbols Loaded' 

    I can see that when I attach the debugger (ctl+alt+p) to the W3P process, it is starting up the 'ASP.Net developer server on a random port' (I just mention this is case it might be relevant).   

     

    Wednesday, December 07, 2011 2:25 AM
  • Then can you help me to zip your Visual Studio Solution and share it to us for researching, or you can just create a demo which can reproduce your problem?

    You said it does not work for you, but all the test is base on a new Application Pool, have you test to use the "Default Web Site" which is there when you install the IIS component in your System?

     


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    Wednesday, December 07, 2011 5:31 AM
    Moderator
  • I am able to replicate it in VS2010 and VS2008,  also using the default app pool as you suggested.

    My 'Test Three' above is how I can replicate the issue.  Roughly,  if I create an asp.net web application and publish to a site in IIS using the filesystem I can debug it by attaching the debugger.  If I create an asp.net website and publish it to IIS using the filesytem I can attach the debugger but there are no debug symbols and breakpoints will not be hit.

    I am using the default project templates that come with visual studio.  All I am doing is creating a new website project, putting a button on, adding a handler and setting a breakpoint on it, publishing to IIS, loading the page in the browser and attaching the debugger.

     

    When I replicated the issue in VS2008 and view the modules, they are all marked as optimised and all but 4 of the modules are marked as 'Cannot find or open PDB file (they are .net assemblies), the 4 remaining are marked as 'No symbols loaded'.

    Out of interest, should these last 4 files be marked as optimised?  When I run the site up in the local debugger by pressing F5 then these 4 files are marked as NOT optimised and the app_web.abcd.dll file has symbols loaded.  I have checked and the same is true in VS2010

    The IIS version is 7.5.7600.16385

    Regards

    Andy

     


    • Edited by AndyW2007 Thursday, December 08, 2011 10:01 PM
    Thursday, December 08, 2011 9:59 PM
  • I don't know why, it always show me that it have not permission to write files to here:

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root

    I solved this problem at first time, but when I do a new test, the problem keeps there, even though I tried the solution what found form internet.

    So I just change the application pool for this new web site to the "Default Application Pool", then browse the web site once, let it generate the symbol(publish with "Emit debug information no symbol", also used my steps in my above posts.)

    When it can be browse, opened the temp folder:

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\...\...

    I can see the libraries and symbols are generated, so I then change the web site's application pool to testApplicationPool(what I created and used to test before as your step2 told).

    Then I can load the libraries and symbols when I use the debugger attach to the w3wp.exe(please ensure the username is your application pool name, if you attach to the wrong process with wrong application pool name, it will not load the libraries and symbols).

    Modules window(Ctrl+Alt+U): Debug->Windows->Modules at debugging time.

    About the IIS configuration and the web site project compile at runtime problem, I'm not a expert, so please use the asp.net forum if you want research that problem. But for the debugging problem's test result is here.

    As I this post described, it would have a "Emit debug information no symbol" option when you publish the web site project, if you checked it, then the necessary libraries's will be not optimised:

    Then you can keep the symbols with the site.

    As it said in my post, the symbols will be in this like path, the web site content is form here which you debugged, this is the real target: "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\...\..."

    In my test, it seems there's some permission problem, which I have not solve it, since I'm not familiar with the IIS configurations. But we can change the web site's app pool to the default app pool, it will allow us generate the symbol there, and then we can change the app pool back to our's and go on debugging work.

    Have you followed the steps and notes in my this post, and test it in your computer, it is my test steps and experiences on this problem after I saw the problem in your this thread.


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Friday, December 09, 2011 6:59 AM
    Moderator
  • I'll mark this as the answer but I have not yet fully tested it as a solution.

    In the web.config I have added the 'optimizeCompilations='false'  to the <compilation debug='true' line.   I noticed that when I was looking at the modeuls <ctrl-alt-U> that the 'optimized' setting was set to true for the modules that were not having their symbols loaded correctly.

    • Marked as answer by AndyW2007 Monday, December 19, 2011 3:06 AM
    Monday, December 19, 2011 3:06 AM
  • I don't think so it is the root cause, since when I use my test, it is displaying the configuration like this:

    <compilation debug="false" strict="false" explicit="true" targetFramework="4.0" />
    

    And after I read the web.config document, I know that the "debug" attribute value is false at default, and the "optimizeCompilations" attribute value is also a false at default.
    I will show my minds as possible to help you once you have any update on this question, though the problem is keeping in your side.

    Have a nice day!


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    Monday, December 19, 2011 3:02 PM
    Moderator
  • I've been going through the wringer on this trying to get symbols to load on my asp.net site on my local IIS using VS2010 remote debugger.

    I had set a symbol path to my apps \bin folder where the files were. I had checked the option to use Microsoft Symbol servers.

    I had checked the Emit Debug Info option when publishing.

    Still no symbols.

    I finally got desperate and started playing with debug options (from the Debug menu). I had "Enable Just My Code" checked and "Enable .NET Framework source stepping" NOT checked. I'm assuming these were defaults.

    Just as an experiment, I checked "Enable .NET Framework source stepping" which automatically unchecked "Enable Just My Code".

    Immediately I saw messages in the status line at the bottom of the VS main window telling me it was loading symbol files (I was currently debugging so the effect was immediate).

    Now I can create breakpoints and they work!!

    This is the first time since I've had VS2010 (I got it when it first RTM'd on MSDN) that I can actually remote debug anything successfully.

    Hope this helps someone!!

    Friday, April 20, 2012 7:47 PM
  • I've been going through the wringer on this trying to get symbols to load on my asp.net site on my local IIS using VS2010 remote debugger.

    I had set a symbol path to my apps \bin folder where the files were. I had checked the option to use Microsoft Symbol servers.

    I had checked the Emit Debug Info option when publishing.

    Still no symbols.

    I finally got desperate and started playing with debug options (from the Debug menu). I had "Enable Just My Code" checked and "Enable .NET Framework source stepping" NOT checked. I'm assuming these were defaults.

    Just as an experiment, I checked "Enable .NET Framework source stepping" which automatically unchecked "Enable Just My Code".

    Immediately I saw messages in the status line at the bottom of the VS main window telling me it was loading symbol files (I was currently debugging so the effect was immediate).

    Now I can create breakpoints and they work!!

    This is the first time since I've had VS2010 (I got it when it first RTM'd on MSDN) that I can actually remote debug anything successfully.

    Hope this helps someone!!

    I also made sure the remote debugger was running as administrator by the way (I'm not using it as a service).
    Friday, April 20, 2012 7:53 PM
  • Thanks for your sharing!

    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Monday, April 23, 2012 6:28 AM
    Moderator