ANTS Performance Profiler
Latest version: 7.4
Knowledge Base
No .NET methods were profiled on web application
Category: Troubleshooting & error messages
Date: 17 Jun 2009
Product: ANTS Performance Profiler
Versions: 2,3,4,5
Platforms: Microsoft Internet Information Server versions 5,6,7
When profiling an ASP .NET web application, the following warning may be displayed when gathering the results:
"No .NET methods have been profiled"
There are four basic causes for this to occur.
* It is possible that IIS is caching the previous request for an ASP .NET page, so that no code needs to be executed to satisfy the request. Caching can be configured in a page directive, causing this behavior.
* The Profiler's "Core" dll was not loaded into the application. When the .NET Execution Engine starts, it checks to see if a profiler is configured by examining the COR_PROFILER and COR_ENABLE_PROFILING environment variables. If they are not set for the IIS worker process, profiling will not take place.
* An attempt was made to load the "Core" dll, but the wrong dll is registered, the registry is incorrect, or the dll file itself is corrupt or missing.
* The Profiler's "Core" dll loaded correctly, but encountered an error.
Verifying that the .NET Execution Engine is loading
=====================================
In the first example, it's necessary to determine whether of not your application is executing managed .NET code in the runtime. This can be done by attaching a debugger or using a process monitoring tool such as Microsoft's Process Explorer. If you notice that the ASP .NET worker process (aspnet_wp.exe or w3wp.exe) has loaded the "mscorlib.dll" or "mscorlib.ni.dll" files, the runtime should have executed managed code. To determine the process that needs to be checked on IIS 6 and 7, the iisapp.vbs (IIS 6) or appcmd.exe (IIS7) tools can be used to resolve an IIS application pool to a Windows Process ID.
If the runtime is not present in your worker process, the site may contain nothing but static HTML, traditional ASP, other scripting code such as PHP, or the page is cached by IIS. You can determine the latter by looking for the following at the top of your .aspx files:
<%@ OutputCache Duration="Seconds" %>
Verifying that the process has a profiler configured
====================================
On IIS 6 and 7, the only way to check that a profiler will be attached to a worker process would be to examine the process environment variables for the COR_PROFILER and COR_ENABLE_PROFILING variables, again, using iisapp.vbs/appcmd.exe and Process Explorer as in the previous case.
IIS 5 is slightly more complicated. Because IIS 5 does not implement the IIS 6 Worker Process Isolation Model, it is necessary to work out the user who will launch the worker process (aspnet_wp.exe) and modify their user profile so that the above environment variables are set in the user environment. This way, any process launched by this user (default: ASPNET) will be profiled.
If the environment can't be modified, a different error message will be shown, so that possibility will not be discussed in this section. If the environment variables are incorrect, this would result in a "failed to cocreate profiler" error (see below). The remaining possibility is that the variables had been set in the wrong profile.
Because .NET supports the parallel installation of many runtime versions, it's important to ensure that you have chosen the correct .NET version in the web application profiling project wizard. The user who will run aspnet_wp.exe is specified in the .NET installation's machine.config file, under the processModel section. If, for instance, your web application is configured to run .NET 2.0, which is configured to run as "USERA" and you also have configured .NET 1.1 to run as "USERB", choosing .NET 1.1 will set the environment for "USERB" and the profiler will not be attached to your web application. Normally, ANTS will automatically detect the correct .NET version, but if the metabase is corrupt or no application is configured for your web app's virtual directory, the wrong user could be configured.
In versions 3 and 4 of ANTS Profiler, there is a known issue that prevents a website from being profiled if the ASP .NET worker process is set to the 'SYSTEM' account in the machine.config file. These versions of ANTS Profiler will not profile ASP .NET code running as SYSTEM. Please see < http://www.red-gate.com/support/kb/KB200708000140.htm > for more information.
Verifying that the Profiler Core is correctly registered
======================================
Rather than checking the registry, you can ensure the registration is correct by re-registering the "Core" dll. First, determine the location of the dll. In ANTS v3, it is in %programfiles%\Red Gate\ANTS Profiler 3\RedGate.Profiler.Core2.dll. In Performance Profiler 4, it is in %programfiles%\Red Gate\ANTS Profiler 4\ProfilerCore.dll. In Memory Profiler 4.0, it is at %programfiles%\Red Gate\ANTS Profiler 4\Memory\RedGate.Profiler.Core2.dll.
Open a command prompt, change the working directory to the folder containing the dll, and run
regsvr32 <name of dll>
If this is successful, then retry profiling. If not, you may need to reinstall ANTS Profiler because the dll is corrupt.
Verifying that the dll is functioning correctly
===============================
If the "Core" dll does load successfully, it may have failed during initialization. When this happens, an entry is written into the Application event log, with the source shown as ".NET Runtime":
"Failed to coCreate the profiler"
Please note that incorrect environment variables or incorrect registry information can also cause the same event log entry to appear. In that case, re-registering the dll as above or checking that the COR_PROFILER environment variable is correctly set to the GUID corresponding to the dll would fix this.
[ANTS Profiler version 3.x]
Name: COR_PROFILER Value: {9AE7D44D-DE91-47cb-9ABA-84BCAA0E5F54}
[ANTS Performance Profiler version 4.x]
Name: COR_PROFILER Value: {A07CBDF0-B23B-4A96-A889-18E3C3004EB2}
[ANTS Memory Profiler version 4.x]
Name: COR_PROFILER Value: {4befac55-31fa-4cf0-84b7-327248147851}
[ANTS Memory Profiler version 5.x]
Name: COR_PROFILER Value: {D60F7519-2600-4865-8AC1-C621C9CE41A2}
[ANTS Performance Profiler 5.x]
Name: COR_PROFILER Value: {60E3DCF2-1A65-4a44-9F41-038582C8181C}
If the environment is set correctly and the "Core" is registered, the only way to find the cause of the problem would be to attach a debugger to the worker process. Since there is probably a bug in the dll at this point, the only reliable way of troubleshooting this would be to send a memory dump of the worker process to support@red-gate.com. Microsoft's DebugDiag can be used to create this dump file.
< http://www.microsoft.com/downloads/details.aspx?familyid=28bd5941-c458-46f1-b24d-f60151d875a3&displaylang=en >
If it is not necessary to use IIS as a platform to run your web application, it is much simpler and less error-prone to use the "'development web server" option to profile web applications. This application had shipped with .NET Framework 2.0 as a cut-down webserver to use for debugging purposes.
Document ID: KB200708000090 Keywords: ANTS, Profiler, IIS, No, .NET, Methods, profiled, cached, ASPNET
Was this article helpful?
ANTS Performance Profiler
- Installation error 5100 when installing ANTS Performance Profiler and ANTS Memory Profiler
- Attach to process unavailable with some anti-virus software
- Memory leaks observed when profiling Windows Presentation Framework (WPF) applications
- Log files
- The manifest for the SQL server event source did not match the generated events. Some SQL events may report incorrect data. To fix this issue, consider recompiling etwcls.mof
- Setting file I/O and child process profiling in high DPI modes
- HTTP request timings in IIS
- Profiling web services in IIS Express
- Method not found: 'UInt32 <Module>._ANTS_Begin_Sql(System.String)'
- Enabling line-level timings for SecurityTransparent code
- Profiling SharePoint 2010 in v6.0 - 6.3
- Profiling SharePoint subsites
- Problems synchronizing results
- Windows service profiling fails if the service uses a system account
- Profiling assemblies protected with DeployLx
- The type initializer for 'y.layout.hierarchic.ClassicLayerSequencer' threw an exception
- Forcing your application to use .NET 4
- Double hit counts occurring on one line
- System.EntryPointNotFoundException (Versions: 3,4 only)
- Methods in (ASCX) web controls may not appear
- Failed to CoCreate Profiler error profiling a Windows service
- Multiple-core portable computers may show inflated times (version 3)
- No .NET methods were profiled on web application
- ANTS Profiler code instrumentation method
- Add-in fails to load when using RunAs to start Visual Studio as another user
- Profiling unit tests using Nunit
- Can I profile Compact Framework applications?
- Profiling a SharePoint 2007 Web Part
- Profiling an assembly in the Global Assembly Cache (GAC)
- Profiling IIS web applications that need to run under the SYSTEM account
- Profiling a web application hosted in IIS on a fixed TCP port
- Profiling client-side XBAP .NET applications
- ANTS Profiler prompts for location of source code which is not your own source code
- ANTS menu remains in Visual Studio after uninstall of ANTS Profiler
- Profiling a web application needing to run as the Network Service account
- Cannot start COM+ application via Remote Desktop
- Finding the overall time taken to execute a thread
- Profiling BizTalk applications
- Profiling Microsoft Office managed-code add-ins
- The system cannot find the file specified
- Error Stopping IISAdmin profiling IIS web application on Windows XP
- Creating a global debugging symbols (PDB) directory
- Using the add-in to profile solutions containing more than one project
- Methods may be missing on multi-core systems in version 3
- ASP .NET 1.x application recycling causing incomplete results
- Application recycling causes incomplete results and other errors when profiling ASP .NET
- (version 5) Support for profiling Silverlight applications
- Couldn't open metabase error when profiling ASP .NET hosted in IIS
- Failed to coCreate Profiler on ASP .NET web application
- HTTP error 404.17 profiling ASP .NET 1.1 on IIS 7
- Performance counters missing from results
- Isolating single ASP .NET pages in ANTS Profiler results
- Missing hits for lines in the source code view
- ANTS Profiler restarts IIS
- Showing the amount of time taken for a method in one particular thread
- Please specify a valid URL message profiling ASP .NET
- Times on individual lines do not add up to method time
- Explanation of "thread blocked" methods in ANTS Profiler
- Call graph percentages do not add up exactly
- Operation could destabilize the runtime error profiling ASP .NET
- IIS ceases to work after profiling web applications
- Problems with ANTS Visual Studio integration
- ANTS Profiler has been split into two distinct programs
- Windows Installer errors 1603 and 2738 occurring during installation
- Times in source code window are greater than the times showing in the method grid or tree view
- Problems with ANTS Performance Profiler Visual Studio integration
- Profiling ClickOnce applications deployed to IIS
- Could not enable tracing due to error code 112
- AjaxControlToolkit incompatibility causing application being profiled to crash
- Could not enable tracing because SQL Express is installed
- ANTS Performance Profiler menu items not showing in Visual Studio 2010
- Profiler stopping while profiling an in-browser Silverlight application
- "No Disk" error occurring while profiling application
- IE error "Internet Explorer cannot display the webpage" when profiling a website
- Profiler failing to connect to the server when profiling web applications
all products
- Some Red Gate products identified as containing a trojan by Anti-Virus software
- Activation may fail with Unknown Error -1
- Product uses web help although a CHM file is available locally
- Argument exception resulting from missing environment variable
- Check for updates may fail when used through proxies
- 'Unidentified Publisher' error when repairing or uninstalling
- Licensing activates product as standard edition
- Moving Red Gate software products to another machine
- Red Gate tools log locations
- The application UI opening slowly when there is no internet access
ANTS Performance Profiler
- Activating your products
- Activating your products
- Interpreting unexpected profiling results
- Choosing a profiling mode in ANTS Performance Profiler 6
- ANTS Performance Profiler 7 release notes - version 7.xx
all products
- Red Gate product acknowledgements
- Activating your products
- Activating your products
- Red Gate bundle history
- Check for updates
- Troubleshooting Check for Updates errors
- Current versions
- Deactivating your products
- Installing Red Gate products from the .msi file
- Requesting additional activations
- Serial numbers for bundles
- Reactivating using a different serial number
- Extending your trial
- Finding your serial numbers
- Moving a serial number from one computer to another
- No response received for manual activation
- Licensing and activation resources
- Licensing and activation resources
- Troubleshooting licensing and activation errors
- Licensing and activation FAQs
- Red Gate tools log file locations
- Download old versions of products
- Download product prerequisites & utilities
- Support & upgrades
- Upgrading your software
- Upgrading FAQs
ANTS Performance Profiler
- Worked example: Profiling an ASP.NET application - ANTS Performance Profiler
- Worked example: Profiling from the command line - ANTS Performance Profiler
- Worked example: Profiling performance of an algorithm - ANTS Performance Profiler
- Worked example: Profiling network overheads - ANTS Performance Profiler

Using ANTS Performance Profiler