I have a server running my web app through IIS. I have visual studio locally, I am attaching to the remote w3wp.exe process with no issues, but my breakpoints are not being hit because my symbols are not loaded.
What am i missing?
Update: Should I be debugging Native or Managed? When I do Native, the Modules window shows a ton of windows dll's that all fail to open the PDB. Should I be concerned? I do not see my dll in the list. When I use Managed, the modules window is completely empty.
Found the issue. When I was attaching to the process via the Visual Studio gui, the w3wp.exe process was listed as x86 instead of Managed 4.0. I recreated my app's site in IIS and the process went back to being listed as Managed, which allowed the symbols to be loaded.
Make sure that you built your project in debug mode. Also, make sure you have sufficient rights for your remote server.
Related
I have developed a windows service on my system and have deployed the service on a target machine which does not have visual studio. Therefore, I need to debug the application from my PC. I already know how to debug a windows service on a local machine.
MY STEPS:
Copied the complete bin folder (containing .exe as well as .pdb files) to the target machine.
Installed the service on the target machine using InstallUtil.exe (i.e installUtil.exe "pathToMyServiceEXE/myService.Exe")
Started the service
Installed Visual Studio Remote Debugging application (started in "No Authentication mode" with Debugging option checked)
Attached to the service in Visual Studio (which is running on my PC)
PROBLEM: I am able to successfully attached to the windows service of the target machine. But it cannot find the symbols.
I have checked other SO questions about the same problem but could not find the correct solution so far. I have tried the following things to solve the problem:
Opened Tools->Options->Debugging->Symbols and then put the path of .pdb files on my local PC. (Didn't work)
Opened Tools->Options->Debugging->General and unchecked "Enable just my code".
In addition to above two, I have already made sure that I am running the x64 version of the Remote debugging tool, Debug/x64 version of windows service and debug/x64 on my local PC.
The best advice that I can give you - which is not the easiest now, but will pay off in the long run - is to use WinDBG debugger on the target machine. This is next to zero setup on the target machine but will require you to learn the basics of WinDBG. This is not trivial but will pay off in the long run.
Regarding why you cannot load symbols:
Maybe PDBs do not match binaries?
Maybe path is not accesible to the current logged-in user? (such as mapped drive, etc)
Maybe permission issue?
Other then that I think it should work
I'm trying to attach to a Web service remotely from Visual Studio (2008). I can attach to processes on the remote machine, but when I attach to w3wp.exe, the breakpoints in my code say "The breakpoint will not currently be hit. No symbols have been loaded for this document".
Something I noticed is that after attaching, the DLL of the service doesn't appear in the list of loaded modules, but I can see other DLLs referenced in the project...
Am I attaching to the wrong process? Only one w3wp.exe instance runs on the remote machine...
UPDATE
Apparently, the remote debugger needs to be installed to allow stepping into web services, it cannot be done if the remote debugger is running from a share.
Since I couldn't make it work and I don't have access to the VS 2008 installer to properly install the debugger on the remote machine, I decided to upgrade the project to VS 2010 (of which I do have the installer)...
However, I still have to manually start the debugger and add permissions to be able to attach... Is there any way you can set additional permissions when the debugger runs as a service?
If the debug symbol resources (*.pdb) are not right there with the libraries then I would say that your solution wasn't built for Debug but rather for Release (or some other build target).
I've personally not been able to attach the debugger to a project without those symbols being loadable. As a solution I'd recommend rebuilding the project for Debug and then deploying it to the suspect environment that needs your debugger.
I'm working on an IIS module written in C#. I'm trying to test out some different types of functionality which is slowing down the development process. Right now I make the code change, build it, move the DLL to my web folder and refresh the website in my browser. This means I have to follow the stack trace every time an error occurs.
Is there some way I can run this directly from Visual Studio so if an error occurs VS will catch it and display the details allowing me to step back and forth through it?
Thanks in advance!
As long ad IIS loading modules DLLs you should be able to attach Visual Studio debugger to the IIS working process, try out to attach to the w3wp.exe process
So I have an unmanaged C++ dll which I am calling from my ASP.NET application, it has a single entry point and a couple of structures for passing data. If I create a C# console app to call the dll it works fine. If I hook it in to my asp.net app running on my local WinXP machine (IIS 5.1) then it works fine.
When I publish it to our development environement which is running Windows 2003 and IIS 6 then the first 1 or 2 calls works fine but then it simply stops responding. I'm getting no error messages, warnings etc... but I am fast running out of hair!
I've set the virtual directory which runs the asp.net app up inside of its own application pool but this seems to have had no impact. Any help would be greatly appreciated.
Cheers
What do you mean when you say that it stops responding? You could try putting logging statements that would trace the input/output around the call to see where exactly it blocks. Also make sure you check the server Event Log where unhandled ASP.NET errors are written. As a last resort you could install Visual Studio remote debugging tools (msvsmon.exe) on the server and step through the code by attaching to the corresponding w3wp process. Actually the debugging tools doesn't require installation, a simple copy is enough (C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger).
The failure appears actually to be with the C++ code itself, it has some code to handle locking for a threaded environment and this appears to be failing. Not sure why it works on my local machine and not the dev environment but that's another question.
Thanks all
I am trying to remotely debug wcf service on IIS 6. It has been working fine until yesterday. Now breakpoints are not being hit and warning message says "No symbols have been loaded for this document". I've solved this by restarting iis and app pool, but it worked just for a few days. Now I have the same problem. I've read almost all advices on the Internet about this, I've checked build options, GAC, ASP Temporary folder. When the service file is loading the VS is writing that my dlls is loaded. But when I looking at the debug->modules window it shows that this modules haven't been loaded. I still can see exceptions while debugging. Now I am temporarily using Debug.WriteLn() for debugging, but it takes a lot of time and effort. Any help will be appreciated.
P.S. I use VS 2010, WinXp Sp3 on my PC and Windows Server 2003 on server.
[Updated] Is there any patches for VS 2010 that can fix remote debugging problem ?
[Updated] I've noticed that w3wp process type is x86 now, although my service was called by client before and it should be managed type.
Finally, I 've found a solution. I copy my WCF output files to the same location on the server as in my pc. It is quite wierd but debugging works perfect.
Here is your answer, and the issue I ran into:
I've noticed that w3wp process type is x86 now, although my service
was called by client before and it should be managed type.
Typically to get the w3wp.exe process to actually show in the Attach to Process debug dialog is to just browse to a site in IIS locally. This will spin up that process and make sure it is available to select.
However, you must browse to a site using the same app pool type as the WCF service you want to debug. If you select an app pool using a 32-bit process (x86) and attach to this for a WCF service expecting a x64 version, the resulting "No symbols have been loaded for this document" will be displayed and breakpoints will appear as 'hollow' red circles.
First: Please Install IIS 7, its much recommended!
2nd: it happens sometimes with everyone I guess, deploying the service again with the options (Delete existing files (checked), with source code (checked) ), resolves the problem.
Actually that's the only solution is working in my case
Regards,
Mazhar Karimi