Solved

How to debug website on Windows Server 2008 R2 IIS 7.5

Posted on 2014-04-13
12
1,919 Views
Last Modified: 2014-04-16
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
Comment
Question by:SergeGregoire
  • 6
  • 5
12 Comments
 
LVL 28

Expert Comment

by:Ryan McCauley
ID: 39999364
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
 
LVL 1

Author Comment

by:SergeGregoire
ID: 40001351
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
 
LVL 28

Expert Comment

by:Ryan McCauley
ID: 40001806
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
 
LVL 1

Author Comment

by:SergeGregoire
ID: 40001827
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
 
LVL 28

Expert Comment

by:Ryan McCauley
ID: 40001895
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:SergeGregoire
ID: 40001908
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
 
LVL 1

Author Comment

by:SergeGregoire
ID: 40004320
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
 
LVL 28

Expert Comment

by:Ryan McCauley
ID: 40004725
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
 
LVL 1

Author Comment

by:SergeGregoire
ID: 40004745
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
 
LVL 28

Accepted Solution

by:
Ryan McCauley earned 500 total points
ID: 40004786
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
 
LVL 1

Author Comment

by:SergeGregoire
ID: 40004840
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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now