What are the challenges you face when working across database platforms? Take the survey
Options

How to profile a website that has custom applicationhost.config?

rgelbrgelb Posts: 45 Bronze 4
edited June 18, 2018 11:43PM in ANTS Performance Profiler
I have Ants Profiler 8.6 (though I have no idea how to do this on the current version either).  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>&nbsp;&nbsp;&nbsp; <application path="/" applicationPool="Clr4IntegratedAppPool"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <virtualDirectory path="/" physicalPath="C:\Projects\net2\Web\Public" /><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <virtualDirectory path="/Include" physicalPath="c:\Projects\net2\Web\Include\" /><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <virtualDirectory path="/images" physicalPath="C:\Projects\net2\Web\Images\Web04\" /><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <virtualDirectory path="/images/common" physicalPath="C:\Projects\net2\Web\Images\Common" /><br>&nbsp;&nbsp;&nbsp; </application><br><br>&nbsp;&nbsp;&nbsp; <application path="/Public" applicationPool="Clr4IntegratedAppPool"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <virtualDirectory path="/" physicalPath="C:\Projects\net2\Web\Public\" /><br>&nbsp;&nbsp;&nbsp; </application>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <bindings><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <binding protocol="http" bindingInformation="*:56788:localhost" /><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <binding protocol="http" bindingInformation="*:80:127.0.0.10" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <binding protocol="https" bindingInformation="*:443:127.0.0.10" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; </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

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.



Sign In or Register to comment.