• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2262
  • Last Modified:

How to debug website on Windows Server 2008 R2 IIS 7.5

Hi,

I insalled Visual Studio 2012 on my production server with the intention to debug my ASP.NET 4.0 website locally and my understanding is that we can't dubug website on a Windows Server 2008 R2.

I then try to access my remote website from my Windows 7 computer and I am getting the error "Error opening web http://mywebsitepath. Unable to open the Web site 'http://mywebsitepath'. The Web server does not appear to have FrontPage Server Extensions installed."

The problem, is that FP Extensions are not compatible with IIS 7.5. I then configure WebDav, but still can't open my website remotelly and remote debug to find what is going wrong with my web application.

I am running my web application locally on my PC and everything is working fine. So I would like to find what I am missing on the web server by stepping trough code.

I am looking for a step by step configuration procedure to configure my IIS 7.5 server to allow remote connection from Visual Studio 2012 and also allow remote debugging.

Thanks for any help.
0
Stephan Bourgeois
Asked:
Stephan Bourgeois
  • 6
  • 5
1 Solution
 
Ryan McCauleyData and Analytics ManagerCommented:
You don't need Frontpage extensions installed to debug your website remotely, and I'd discourage you from installing them even if you could. You need to install and configure the .NET remote debugging tools:

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

Once you install and launch that tool, you'll be able to use Visual Studio on your development workstation to connect to your web server and attach to the w3wp.exe process that's hosting your application pool. From there, you can set breakpoints, step through code, and debug normally.

A warning, however - if you attach and debug on your production website, breakpoints will affect all users of the site, and the server may appear unresponsive. Just a heads up that it's definitely an after-hours (or other downtime) activity.
0
 
Stephan BourgeoisIT SpecialistAuthor Commented:
I installed the remote debugger and it start correctly, but I can't open the remote website from my pc.

Trying to check if the Windows Web Service API is installed. Where should I check? Can't fin any download.
0
 
Ryan McCauleyData and Analytics ManagerCommented:
I haven't had to install any kind of API to do remote debugging. Is there a firewall between your development box and the web server? If so, the remote debugging ports (TCP 135, UDP 4500 and 500, among others) need to be opened:

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

Do you have a local instance of IIS on your development workstation? If so, I'd encourage you (instead of attaching a debugger on the production server) to copy the site to your local box and run it there, since you already have the debugging services installed and running. You can then connect visual studio to your local IIS much easier than doing it remotely, and the effect will be the same of you seeing how the site acts inside IIS rather than inside Visual Studio's build-in web server.
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
Stephan BourgeoisIT SpecialistAuthor Commented:
I have a local copy on my pc and the site is working perfectly.

I am using DirectoryEntry to update Active Directory entry. The active directory update work fine on my pc and does not seem to work on the production server.

I would like to find what is missing on the server to support Active Directory update using Directory Entry.
0
 
Ryan McCauleyData and Analytics ManagerCommented:
When you run it on your local PC, are you using IIS, or are you running it directly from Visual Studio? Is the application pool user the same both locally and remotely, and is there any other configuration that could be different (Windows version, for example)?
0
 
Stephan BourgeoisIT SpecialistAuthor Commented:
My local pc is a Winodws 7 SP1 fully updated and the production server is a Windows 2008 R2.

I am using DOTNET FRAMEWORK 4.0 and the latest Ajax Control Toolkit.

Here are my imports for Active Directory:
Imports System.DirectoryServices
Imports System.DirectoryServices.AccountManagement
0
 
Stephan BourgeoisIT SpecialistAuthor Commented:
I have created a new application on the production server and my web application is working fine.

I would like to know anyway why I can't connect to the debugger of my production server and it keep telling that the FrontPage extension are not installed.
0
 
Ryan McCauleyData and Analytics ManagerCommented:
To your comment, setting up a new application and having it work as expected makes me wonder if the user accounts hosting the application pool for both web apps is the same - if you're using a different user to hold the app pool, could permissions differences be an issue? Alternatively, could configuration of the app pool (integrated vs. classis ASP.NET pipeline, for example) be a factor as well?

I haven't used FPE in about 10 years, but I checked - it looks like Visual Studio (through at least 2008) still uses it when publishing a click-once site, even though the technology in general has been deprecated in favor of WebDAV (which the modern servers support natively). FPE is a deployment feature, and I can't think of any reason you'd be prompted to install it while attempting to use the remote debugger. Are you trying to deploy a new copy of your site, or just attach Visual Studio's debugger to the version that's already on the server?
0
 
Stephan BourgeoisIT SpecialistAuthor Commented:
I am getting the prompt when I am trying to open the remote website from my pc. To debug the site on the remote server, I assume I need to open it in the IDE.

I use the same application pool for both web application. ASP.NET 4.0 integrated.
0
 
Ryan McCauleyData and Analytics ManagerCommented:
If you're trying to browse the files on the remote website, that could use FPE. To debug it, you don't "open the site" in the IDE, but you open the source code for the website (whatever you compiled and deployed in the first place) in your IDE and then under the Debug menu, you select "Attach Debugger" and select the remote server, and then find the relevant w3wp.exe service.
0
 
Stephan BourgeoisIT SpecialistAuthor Commented:
Thanks ryanmccauley.

I succeed to debug my web application.

To recapitulate,

1. I open my web site locally on my pc.

2. I attach to w3wp.exe on the remote server.

3. I browse to the remote website and I can step trough the code.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now