How do I debug a site on a server locally? If you want to debug the site on the server locally we need to use a remote debugging tool msvsmon.exe. We can find it again in the VS installation directory such as: C:\Program Files (x86) \microsoft Visual Studio 12.0\common7\ide\remote Debugger\x64\msvsmon.exe Because the Msvsmon.exe program needs to run on the server, we can set the directory of the program as the shared directory, or copy it directly to the server: runMsvsmon.exe before the program needs to shut down the firewall, how to familiarize with the firewall configuration can be specific firewall configuration,It shuts down the firewall directly to keep the traffic running. Now running on the servermsvsmon.exe programs, which can be run from a copied file or from a shared directory Here we debug in a non-authenticated manner, open the Options menu in the tool, make the following configuration Click OK now our server is also configured. Now start debugging the site on the server in our native vs. Open our project, under Select Tools menu bar Attach to process, select Remote mode for transfer click Find Host in Search network select our server host to connect, attach we want to debug the worker process on view serverMsvsmon The status of the program, you can see the connection is successful Then we set breakpoints in VS and visit our server site at this point we can see that the breakpoints in VS are not interrupted. Let's look at the output window to see a message that our current site is compiled into an assembly that is not loaded into the corresponding PDB file, so it cannot be debugged. At this point we need to get to the corresponding PDB file of the assembly. Here we can directly copy the publish file on the server directly to our local, and the following configuration for VS will first open the Tools menu bar options, expand the symbol under the Debugging node, add a new symbol file location, Location directly point to the bin directory in the file we copied from the server, if there are multiple sites to add multiple location information, can also point to the remote server's shared directory location, there may be other problems here, and then we expand the General node in the debugging options, The cancel general requires that the source file exactly match the original version option. Because our development code will always be different from the presence of the publication again attaching the process to see the loaded symbols in the output finally we visit the site on our server, we can see that the breakpoint was successfully interrupted note: 1.access to the server Web site is interrupted during remote debugging, so multiple requests can cause differences in debug results 2, although we can create more than oneMsvsmon instance, but a worker process can be attached to only one user 3. The missing PDB file does not directly point to the PDB in our development project in the Bin directory, because the project code is often different from the code of the publishing site . because the PDB file generated by the local development code does not match the assembly of the publishing site correctly, the PDB file cannot be loaded correctly
4. You can use a network share or other way to expose the PDB file on the server site, the local vs get PDB location can point directly to it, because the PC and
network Environment Differences, this attempt may be problematic and requires patient testing (tested, network unobstructed, normally available)
5, the example of this article uses a no authentication method of remote debugging, there are some security issues, you can alsoMsvsmonusing remote debugging that includes authentication, when vs uses the additional process, the default mode of transmission is used, and the computer account configuration is required.
Remote debugging of IIS sites in VisualStudio