How to run debug diagnostic tool as a service - iis

Is there any way to run debug diagnostic tool as a service?
I want to collect IIS/App Pool crash dump in one of our servers. However, the server logs-off users after a few minutes of inactivity, which would close the debug diagnostic tool application. Running the tool as a service, if possible, would solve this problem.
OS: Windows Server 2012 R2
IIS: 8.5

Related

Remote debug Azure web job with .NET 6 in Visual Studio 2022

I followed this tutorial to create a simple web job in Azure: https://learn.microsoft.com/en-us/azure/app-service/webjobs-sdk-get-started. The web job itself does its job, consumes the message in the queue and I see them appear in Application Insights.
However, I want to debug the function on my local machine by using the tools available in Visual Studio 2022.
I have published with following profile settings:
Next I've attached the debugger under het Hosting menu:
First thing I noticed is a message about no symbols being loaded when putting a breakpoint in the function:
When I add a message to my queue, it gets consumed by the web job but the breakpoint is never hit. I've been reading a lot of similar questions regarding a this issue but I'm not progressing any further.
In Azure Portal, I've enabled Remote debugging under Configuration > general settings
In Visual Studio 2022, I checked if the correct process is attached
Here I'm a bit confused thou, the connection target is connecting through port 4024, which is according to this document, the port for Visual Studio 2019. However, a connection target with port 4026 is not found.
What am I missing here? Am I forgetting another setting somewhere?
If have tried changing the stack setting .NET version from APS.NET V4.8 to NET 6 (LTS) but that didn't help.
Should the platform architecture match the architecture of my machine in order to get it to work? Or is this not linked in any way with the debugger?
Is there anything else that I should check or try? Because my hair is turning grey here :)
Apologies for the delay here!
It should be 4024 for both 32 and 64 bit.
See this Azure doc: Remote Debugger Ports on Microsoft Azure App Service
Typically, the error “The breakpoint will not currently be hit. No symbols have been loaded for this document.” -- This error message indicates we can start debug process and attach, but cannot set a breakpoint on any or some lines of code in the project.
Most, likely cause: Application is built without debug symbols or debug symbols are not available
Kindly try these steps:
Verify Debug Symbols are being used and published and in sync
Workaround the issue by disabling “Enable Just My Code” from the
Tools >> Options >> Debugging >> general menu in Visual Studio
Other things to narrow-down the issue:
Debug symbols must be available locally or deployed to the Azure App Service, and must match the local code you are trying to debug.
It is recommended to use Cloud Explorer over Server Explorer to
connect and debug which requires the Azure SDK.
You could optionally Manually Attach a Debugger to Azure Web Apps to troubleshoot this further or recommend this as a workaround.
(old blog, try similar steps)
Kindly verify the port (Visual Studio remote debugger port assignments ) required is open in the corporate firewall and on your local machine.
As a test, you may use tool like Wireshark/netmon, to see if the port successfully connects to the port (4024) needed by the process.

ASP.Net core 2.2 deployment issue in IIS

I am new to .Net core environment and facing issue while deploying application into IIS.
After publishing code and deploying into IIS server(Version 7), I am able to start application from Kestrel by going into directory where application hosted and running below command.
c:\inetpub\demoapp\dotnet "My App.dll"
By running above command, Kestrel is running on http://localhost:5000 and I am able to browse from browser. I am using latest .Net Core version 2.2.
But when I am trying to execute URL from IIS hosted application, I am getting below error.
HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure
Below is the event log from windows application log.
Application '/LM/W3SVC/49/ROOT/demoapp' with physical root 'C:\inetpub\demoapp\' failed to start process with commandline 'dotnet .\MyApp Web.dll' with multiple retries. The last try of listening port is '2405'. See previous warnings for details.
Anyone having idea how to resolve it?
In my case, It was win-64 architect issue.
You can change or switch architect from win-64 to win-86 then publish and don't forget to change Enable 32-bit Applications in IIS manager:
Right-click on the Application Pool and select “Advanced Settings…”
or select the same from the Actions pane after selecting the
Application pool.
Change the “Enable 32-bit Applications” to True (if you want the
application pool to spawn in a 32-bit mode)
Click OK.
p.s.: Don't forget to delete existing published files.

Unable to see "Management Service" in IIS 10 (Windows 10)

I have windows 10 (pro) and IIS 10 installed on Server A. I was trying to publish a Web API from Visual Studio 2015 on Machine B to Server A, but I get the following error.
web deployment task failed. (Could not connect to the remote computer ("172.26.50.17") . On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.
I understood from googling that the web server need to have Management Service installed and running. I have installed web platform installed and I can see that the "Web depoy 3.6 without bundled SQL support(latest)" component installed.
But I still do not see management service icon under "management" section on IIS. Could anyone please help me understand this?
I solved it by installing the Web Platform Installer (Web PI).
Then you can add a lot of tools using this Web PI. One of those tools is Management Service which can be enabled via Web PI.
If you do that and still cannot see the Management Service, try closing and opening the IIS Manager again.
UPDATE:
For Windows 10 and later, see the #RBT comment below.

Remote Debugging Azure App Service Site Fails

I'm trying to debug an ASPNET Core/EF Core website hosted on Azure. When I try to attach the debugger in VS 2015, via Cloud Explorer, I get this error message:
Yet when I check the site in the Azure portal, it sure seems like it's 32 bit and set to enable remote debugging:
So what am I missing or doing wrong?
Portal setting controls the bitness of the IIS w3wp process. But ASP.NET Core runs in its own process, so that setting has no effect on it. Instead, what determines whether your .NET Core process runs as 32 or 64 bit is how you publish it.
Given that apparently your Core project is published as 64 bit, you might want to try switching the Portal setting to 64 bit. This will affect the debugger MSVCMON.exe process, which should then allow you to attach.

Debugging WCF services in Visual Studio 2012

How can I tell which of my services is the one that I am trying to debug?
Using the Visual Studio 2010 debugger I would just look for the w3wp (or whatever the heck it was) that was running under the app pool username that my service was running under.
But now in my attach to processs window I have 3 msvmnon.exe processes and I don't see any wcf services running? What am I missing?
What I wasn't doing was checking the show processes from all users.
Set your WCF services project as startup in VS 2010. Then run the project, you will get a window with all services defined on the left side. Click on the service you wish to execute and pass parameters if any

Resources