Debug .net core application deployed on local IIS? - asp.net

I have deployed my .net core 2.1 application on local IIS but I can't debug my application. I have also tried attaching with w3wp.exe process of my own created "No managed code" application pool but still can't debug my app.
Updated: I had found a solution to run dotnet.exe and my deployed process together and I succeeded one time but after that dotnet.exe disappeared from the process list and I can't find it anywhere but it exists in C:/ProgramFiles/dotnet I have also tried restarting VS but still no luck. So can I get dotnet.exe process back?

Ok, so with the help of Lex Li comments and google, I have found the solution of debugging Asp.net core app deployed on local IIS.
We need to attach with 2 processes to debug the app
dotnet.exe
devenv.exe (the title of devenv.exe would be the
same name by which our app is deployed on IIS.
Note: sometimes we might not find dotnet.exe process in the "Attach to process" list even it would be available in C:\ProgramFiles\dotnet. So we just need to refresh our IIS deployed app on browser and dotnet.exe process will be available in the list then.

Related

Visual Studio 2017 Remote Debugger not hitting breakpoints

I have recently deployed my ASP.NET Core application to my IIS8 server. However due to some issues, I have to remotely debug it.
I installed the Remote Debugger and managed to connect to the server and Attach a process.
However, I am unsure of what to attach from there. I have tried attaching all dotnet.exe and w3wp.exe processes but each time I do that, my breakpoint turns white and says that it won't hit.
I took a look at my Modules tab and for some reason, my symbols aren't loaded for my application dlls. I have made sure that the configuration is Debug and that the ASPNETCORE_ENVIRONMENT is Development.
Currently this is what I am doing:
Run the Remote debugger on the IIS server
Run the website on my local laptop
Attach a process in Visual Studio

How do I target a specific Application Pool when using Visual Studio 2012's Web Deploy?

My application can not deploy because of the following error:
Web deployment task failed. (The application pool that you are trying to use has the 'managedRuntimeVersion' property set to 'v2.0'. This application requires 'v4.0'.)
Right now, I'm attempting to deploy my .NET application to IIS. VS is attempting to target the "DefaultAppPool" application pool. I want it to instead target the "ASP .NET v4.0" application pool. How do I do that in Visual Studio?
I am trying to not change any settings within IIS if possible.
I don't know if this would be considered a hack, but it got the job done without any issues.
What I did was I first created a folder in IIS and then converted it to an application. After which, I had it target the .NET 4.0 application pool and voila, Visual Studio was able to deploy the application without the error.
I hope this helps people in the future that Google their issue and come upon my question.

Visual Studio 2012: Unable to attach the process. A debugger is already attached

I built solution, created application in IIS and mapped it to the application folder. It works fine. Then I go to "Attach to Process", there are two w3wp.exe processes in list, but for one of them I get error "Unable to attach the process. A debugger is already attach." I've googled it but I can't find solution for my problem.
I have installed Debug Diagnostic Tool v2.0 and as a result I have Debug Diagnostic Service which is started automatically and attached to one of w3wp processes. After turning off and disabling this service all works fine.
So the general rule: if you get such error check processes in task manager which can capture your w3wp process.
You have 2 instance of VS and two entries in IIS running on the same application pool, for instance Both Server and Intranet are running on the same application pool.
=> Solution open IIS :
° Select the site and click 'Basic Settings' : Here you can check/select
the application pool used.
° Click on the "Application Pools" node (right under your computer name)
=> You get a list of defined application pools.
° Right click under the last one defined to open the context menu and
select 'Add Application Pool...'
Create a new name and give it the same parameters that the one that was used
by your site.
° Select the 'Basic Settings' of one of your sites and change its application
pool to the new one just created.
=> Now Server and intranet have different application pools and your can
debug the both at the same time.
Hope this helps.
For me, even after disabling the Debug Diagnostic Tool v2.0 this issue didn't fix. So, I rebuild my webservice, pushed the DLLs on the IIS and restarted the it, which fixed the issue for me.
This issue may occur when you make changes in the your web service which is hosted on your local IIS and those changes are not pushed.
Debug Diagnostic Tool v2 Update 2
https://www.microsoft.com/en-us/download/details.aspx?id=49924
Can use this link if the link provided by #mtkachenko above doesn't work
Have this in Visual Studio 2019 but after the debugger crashes on occasion. Without restarting the PC, which can be a slow affair, create a temporary second application pool and switching the site over to the new app pool in IIS also works.
Really odd - but this simple thing works for me:
Go to some file in your main project.
Go to Project menu and choose Set as start-up project.
This might seem redundant if you've already chosen that project as the start-up project before, but it seems to work.

intermittent 'unable to start debugging on the web server...' in VS2012

There are a number of questions on stackoverflow relating to being 'unable to start debugging on the web server...' but I have variation of this problem: it's intermittent and it goes away if I restart VS2012. This would tend to indicate that some process or other is locking up another process, or a file is locked, etc, etc by devenv.exe (ie VS2012) and closing VS unlocks the file/process/whatever.
The Visual Studio solution contains a number of MVC4 websites that use IIS running on my 64-bit Windows 7 development computer. All the website, domain model and test projects in this VS solution are configured for .NET 4.5. MvcBuildViews is set to true in the CS project file.
I've tried recycling the IIS application pool for the start-up project, stopping and starting the IIS site, resetting IIS completely, to no avail. I have a suspicion the error message may actually be incorrect, but it's only a suspicion. Any ideas anyone?

Unable to debug ASP.NET Applicatation using VS 2008 on IIS 7 running on Windows 7 x64

I've been trying to debug an existing asp.net web application that requires me to debug against an IIS website.
I've installed the app and can navigate to it on localhost. However, when I start VS 2008 as an Administrator and try to debug it, I get a message "Unable to start debugging on the web server. The IIS worker process for the launched URL is not currently running."
I've looked through some of the help file contents and can't seem to figure out what is going on. Clearly, the IIS worker process IS running, since I can navigate to the site locally without VS open.
My boss has suggested that it might be because my OS is 64 bit. Any ideas?
You must start the IIS worker process for the application pool,
Place a test HTML page in the web application folder. Access to this HTML page to initiate a w3wp.exe process for this application pool.
Attach VS debugger to this process.
Start to access the ASPX pages and do debugging.
Be sure you are using the x64 or x86 debugger respectively depending on how you compiled your app.

Resources