asp.net debugging - asp.net

Have a website going live soon. Have installed VS2008 on my prod server (temporarily) and wish to debug code when I access the actual prod web link. In other words, I want to attached to the w3wp.exe service from w/in VS2008, then open a browser using the prod link of www.xyz.com - thus giving myself the ability to debug an actual prod call - instead of going through the \\localhost:0000.
I am on a Windows 2008R2 server and know VERY little about firewall settings for trying to access this remotely from my home PC...All past attempts have failed.ThanxJerry

If you have the studio installed on the production server just copy all the source code there, point IIS to the folder with your source code and it will be exactly like on your local machine.
If you get errors or other problems, please elaborate - "All past attempts have failed" is not really meaningful.

Related

Local Debugging IIS application on my laptop using using remote IIS applications (with Rider)

I was witching and had my first few ASP.NET Razor Pages projects, debugging locally, publishing after, and everything went fine.
But now I temporarily took over a project from somebody with health issues, can not ask him things at the moment, maybe next month.
The projects run on two physical servers, five IIS-applications running, like API, Video-Handling, IndentityServer and a "WEB" for the user-interface. Endpoints defined in the "appsettings", I get it.
I changed some minor things at the User-Interface (WEB-Application), published it directly on the server and everything went fine. Pfff..
But... now I want to make some bigger changes and test them locally before publishing, but still using other unchanged IIS servers on the two servers, which do the "heavy-lifting". So I put some breakpoints like always, run "Debug" on Rider, express IIS server starts successfully, but I noticed the application redirects to the project on the remote server and then of course does not meet my breakpoints anymore, it is just running the old version on the server. Now I am missing something..., looked at several configuration files, how can I configure it, when it starts with the local IIS express server instead of the remote server? I want to stay on the local IIS express server, since I want to test the changes of course.
Hope I explained my issue well enough, did not know how to tell exactly.
Greetings to all!

Problems publishing site to localhost on windows 2008 rs server

I must preface this post by saying that I am not an experienced developer, I am in the process of learning through trial and error and a lot of google searches so detailed (step-by-step) feedback would be greatly appreciated. I created a website, which does not use a database, using visual studio 2015 and I am attempting to host it locally on a Windows 2008 R2 server.
I installed IIS and loaded the asp.net v4.0 framework. The site works fine, produces no errors when I test it and works after being published only if the visual studio is still running.
However, when I close the Visual studio and open my browser window to http://localhost:50044 (which is the URL listed in properties menu in VS), I also tried using port :80 and nothing. When trying to add Web Site via the IIS management utility I receive the following authentication error: ”Cannot verify access path (C:\Inetpub\wwwroot).”
I checked the permissions and windows authentication is enabled with read access, and all other permissions seem to be correct. I am at a loss, I'm sure it is probably something simple that I am missing due to my lack of knowledge and experience. Any help would be appreciated.
It's sounds like you are running on IIS express which in your case stops running when you close visual studio. Normal process is create a new website in IIS and point to the folder where your web.config is. You can then hack your host file (C:\Windows\System32\drivers\etc) so DNS works. Add an entry like "127.0.0.1 mytestwebsite.com". I hope that helps
So I figured out part of what was happening. I didn't realize that visual studio has built in IIS and was using that by default.
I ran VS as an admin, created a new project, then attempted to create a virtual directory thru VS under the project/properties/web tab. I selected local IIS and entered http://localhost/boc and it returns an error: unable to create vd. Web server http://localhost... Could not be found.
I then went in to the IIS manager and set up a virtual directory with no issues. However, when I attempt to reference it thru VS I again receive an error message.
Any ideas?

ASP.Net Server Debugging

I am having a problem with my application. The application works perfect on my development machine. It fails, without any errors on the live server. The page loads, but the code doesn't execute apparently.
I have been stuck on this for a while because I can't figure out how to get any information on the problem. There are no errors, so my custom errors settings in web.config are not helping.
I looked around online and I heard there was some remote debugging tool. The article was from .Net 1.0. I tried to follow it, but its not going to work because I am using a shared server. I do not have permissions to start the remote debugger on the server side.
I tried creating some output text files with variable contents, but the files are not being created either. They are created on my development machine, but never show up on the server, again with no error.
I have no idea how I'm supposed to figure out what is going on, because I'm not able to step through the code once it's on the live server.
Is there anyway to step through, or debug the code once I've published it? If I spent the extra money on a VPS, would that allow me to debug on the server side? I'm assuming I could just install Visual Studio on the VPS and step through the program. I've never used a VPS before.
Unless you do something very special in your code, it is unlikely that it behaves differently on your server compared to your workstation.
It is more likely that the configuration on the server is not correct.
You are saying your
code doesn't execute
How do you know that? You should first confirm that your code is actually executing.
you are also saying:
it is now directing me to a page that says "Directory Not Found"
a web server it never looking for directories, it is looking for resources, check your iis http logs what substatus codes are you getting?, enable Failed Request Tracing and review the logs.
Using Process Monitor can also help determine what the web server is doing.
Start with a very simple page and see whether that executes fine.
What I'm saying is, first debug/fix the execution environment before trying to debug your code.
You would never install Visual Studio on a server, the default installation of a Windows Server doesn't even allow you to install it. Instead you can use remote debugging components on the server and use your local Visual Studio to debug remotely.

Web Deployment Manager "Unknown Error" (IIS7)

I've been at this all day, trying to get Web Deployment setup on my server. First off, I'm running IIS7 under Windows Server 2008 Data Center 64bit (on a VPS). At first I thought I had it working, but it seems I was using the old (Windows Administrator login only) IIS6 stuff that comes alongside IIS7.
I've followed this guide perfectly, and I'm still getting errors: http://learn.iis.net/page.aspx/516/configure-the-web-deployment-handler/.
This is the error I receive (as per the directions at the end of the article): http://i.imgur.com/1HC7F.png
Any help is appreciated. I've tried everything (I've verified all the basic things like LOCAL SERVICE folder access, IIS Manager permissions, the service is active, etc).
Thanks, I know someone on SO knows this stuff ^_^.

Debugging with VS2008 will not work after changing Hostname

I am currently using Visual Studio 2008 on XP Pro SP3.
Developing against http://localhost/ everything including debugging works fine.
I need a second website on my machine. IIS 5.1 only allows one website at a time so I used the JetStat XP Pro IIS Admin tool to create a second website. This runs by stopping the Default website and starting the other.
I have added the new website name into the Hosts file and mapped to 127.0.0.1.
Websites can be accessed via this address http://NewHostname/VirtualDirectoryName
Projects can be started without debugging (Web Applications & Websites).
However, when I try to debug I get an error: "Unable to start debugging on the web server. An authentication error occurred while communicating with the web server."
Integrated Authentication is enabled in IIS.
I have seen a lot of documentation with many fixes for "unable to start debugging on the web server" errors but they all seem like huge overkill for my problem, after all, debugging works fine provided I'm not doing it on this different hostname. They talk about doing things that I would do if debugging did not work at all even with http://localhost/.
Is there a place where I can just add this new hostname so that VS debugging is allowed? Do I need to change permissions somewhere? I feel like there should be a really simple solution that I'm just overlooking.
Here's a description of the problem: http://blogs.msdn.com/webdevtools/archive/2008/08/13/debugging-a-website-with-a-host-header.aspx
And here's the recommended registry workaround: http://support.microsoft.com/kb/896861
Do yourself a favour and download IIS Admin .NET.
This handy little tool allows you to switch between your websites at a snip - each one will become localhost when activated, and crucially, get you out of this debug debacle.
http://www.codeplex.com/iisadmin
You do have to add the hostname to a value within the registry.. but I can't remember where.
Since you can only have one website running at a time, why don't you just have them all running as 'localhost'? This way you don't have to change any annoying registry settings but you still have your applications running in individual IIS Websites.

Resources