Last post Dec 21, 2020 03:17 PM by Alon S
Dec 20, 2020 11:37 AM|Alon S|LINK
I'm trying to debug my webapi with IIS
When I first published the app it created an application pool with the same name of the app.
That's not good since I want to use my own app pool.
So after changing the virtual application folder to use my app pool, now when I run debug in VS 2019, it tells me that it can't start the app pool or something because it's trying the old one.
And no, starting my url manually and then attaching a debug to the w3wp process won't help me because I want to debug the Statup.cs file and once that process is up, that code won't be ran anymore.
What do I do?
Dec 20, 2020 07:52 PM|bruce (sqlwork.com)|LINK
Not sure what up mean by my own app pool, but asp.net core hosting requires a unique app pool per application. this is because asp.net core does not support app domains.
anyway, it’s a lost cause. You can not easily debug startup. You should use error logging instead. But if you need to debug, add a sync delay in startup for long enough that you can attach the debugger.
Dec 21, 2020 03:17 PM|Alon S|LINK
I had to use a specific app pool that I already have. It's used only for this project. But it has a specific user running it which is used for encrypting data all over the place using DPAPI. Then to change the app pool that VS 2019 creates would require
knowing that user's password which is not available. And changing that password would invalidate all encrypted data. Basically. But I think the delay approach will work.
It also bothers me that I have to manually do an iisreset each time I build my project because the dll is locked.
VS does it automatically but since I broke it by changing the app pool of my project manually...