How to profile a website that has custom applicationhost.config?
rgelb
Posts: 45 Bronze 4
I have Ants Profiler 8.6. I have a solution in VS2017 that has several web applications (some are webforms, some are just api end points) with a custom applicationhost.config in the %solutionDir%\.vs\config, which makes some of these websites a virtual directory of another.
Example:
<site name="Public" id="2"><br> <application path="/" applicationPool="Clr4IntegratedAppPool"><br> <virtualDirectory path="/" physicalPath="C:\Projects\net2\Web\Public" /><br> <virtualDirectory path="/Include" physicalPath="c:\Projects\net2\Web\Include\" /><br> <virtualDirectory path="/images" physicalPath="C:\Projects\net2\Web\Images\Web04\" /><br> <virtualDirectory path="/images/common" physicalPath="C:\Projects\net2\Web\Images\Common" /><br> </application><br><br> <application path="/Public" applicationPool="Clr4IntegratedAppPool"><br> <virtualDirectory path="/" physicalPath="C:\Projects\net2\Web\Public\" /><br> </application> <br> <br> <bindings><br> <binding protocol="http" bindingInformation="*:56788:localhost" /><br> <binding protocol="http" bindingInformation="*:80:127.0.0.10" /> <br> <binding protocol="https" bindingInformation="*:443:127.0.0.10" /> <br> </bindings><br></site>
I am confused as to how to profile the application that respects the applicationhost.config changes. The UI for the Ants Profiler (under the IIS Express - ASP.NET) lists only WebSite1 (wherever it gets that from). I've tried downloading Ants Profiler Visual Studio Add-In and selecting Ants/Profile Performance from the menu. However, that kicks off IIS Express on port 8013 (again, not sure where that comes from) and gets a template of the applicationhost.config from c:\program files\iis express\app server and then it changes it.
Copied template config file 'C:\Program Files\IIS Express\AppServer\applicationhost.config' to 'C:\Users\rgelb\AppData\Local\Temp\iisexpress\applicationhost201866181729411.config'
Updated configuration file 'C:\Users\rgelb\AppData\Local\Temp\iisexpress\applicationhost201866181729411.config' with given cmd line info.
Starting IIS Express ...
Successfully registered URL "http://localhost:8013/" for site "Development Web Site" application "/"
Registration completed
IIS Express is running.
Enter 'Q' to stop IIS Express
Updated configuration file 'C:\Users\rgelb\AppData\Local\Temp\iisexpress\applicationhost201866181729411.config' with given cmd line info.
Starting IIS Express ...
Successfully registered URL "http://localhost:8013/" for site "Development Web Site" application "/"
Registration completed
IIS Express is running.
Enter 'Q' to stop IIS Express
Predictably, when the application runs and the virtual directories are missing, the application fails.
So, how can I profile my solution while respecting the applicationhost.config?
P.S. I know I can attach to a running process, but I want to profile the startup of the application as well.