ANTS Performance Profiler - 6.2
Learning ANTS Performance Profiler - 6.2
Profiling SharePoint
ANTS Performance Profiler can profile managed code that runs on a Microsoft SharePoint server because Microsoft SharePoint 2007 is implemented as an ASP.NET web application.
Please note that SharePoint 2010 is not supported in ANTS Performance Profiler version 6.2. SharePoint 2010 support is included in versions 7.0 and above.
Setting up the Performance Profiler
To profile SharePoint, on the ANTS Performance Profiler Settings dialog box, perform the following steps:
- Open Internet Information Server (IIS) Manager and stop the website.
- In ANTS Performance Profiler, under Choose application type to profile, click ASP.NET web application (IIS).
- Enter the path to the ASP .NET web application that hosts your site collection. The path should be in the following format:
http://server:port/The server is the name of the local server and the port is the TCP port that the web application normally runs on. If the site collection is on the root virtual directory for the site, you must include the trailing slash.
Note that you enter the path manually, because the drop-down list of available sites does not support SharePoint.
- Select the required Profiling mode, SQL and file I/O, and Profile child processes options; see Working with Application Settings.
- Select the port on which to profile your application:
- If you are using IIS 6 or IIS 7, select Unused port and choose a port that is not used by IIS.
Note that this will not work if your application's code specifically binds to a specific port.
- If you are using IIS 5, or if you are using IIS 6 or 7 and your application binds to a specific port, select Original port.
IIS will restart so that the profiler can attach to the port.
If IIS does not restart correctly, use IIS Manager to stop the website until you have finished profiling.
The port where the application will be profiled is displayed at the bottom of the ANTS Performance Profiler Settings dialog box.
- If you are using IIS 6 or IIS 7, select Unused port and choose a port that is not used by IIS.
- If required, select Manually specify ASP.NET account details and enter the User name, Password and Domain.
ANTS Performance Profiler profiles your web application as the Windows Local System user. If the Windows Local System user might not have appropriate permissions to use SharePoint site collection, enter the credentials of a user who does have the required permissions. Note that the user you specify must be an administrator.
- If required, change the performance counters to record; see Setting up Charting Options.
- Click
.

Use your SharePoint 2007 site collection as normal. Any additions that you have coded, such as web parts and lists, will be reflected in the ANTS Performance Profiler results if these objects have been accessed.
During a profiling session you can interact with the profiler whilst your site collection is still being profiled, and obtain results by selecting areas of the timeline.
When you have finished interacting with your web application, click the
Stop Profiling button in ANTS Performance Profiler.

Note that you can only profile SharePoint site collections running on the computer where the profiler is installed.
Troubleshooting SharePoint Profiling
There are two main problems that you may encounter while profiling SharePoint:
- ANTS Performance Profiler cannot read from the directory which SharePoint writes data to.
- ANTS Performance Profiler cannot profile SharePoint because of security restrictions in ASP.NET.
ANTS Performance Profiler cannot read from the directory which SharePoint writes data to
The most likely cause of problems while profiling Sharepoint is that ANTS Performance Profiler cannot read from the directory which SharePoint writes data to. To fix this:
- Create a temporary directory
- If you are not on a sensitive system, allow full read/write access to this temporary directory to all users. If you are on a sensitive system, ensuring that the local system account has read/write access should suffice.
- Use Control Panel to add a new environment variable. The variable must be called RGIISTEMP and the value is the path to the temporary directory you just created.
For more information, see Chris Allen's blog post, 'Profiling SharePoint with ANTS Performance Profiler 5.2' (This blog post is also valid for ANTS Performance Profiler 6.2.)
ANTS Performance Profiler cannot profile SharePoint because of security restrictions in ASP.NET
Security features in ASP.NET may cause problems on some systems. To fix this:
- Obtain the required information.
- Grant permissions.
- Ensure that compilation with be in DEBUG configuration.
- Copy PDBs and web part DLLs to the app_bin directory.
1. Obtain the required information
Before you start, you need to know the following details for the site collection which you are profiling:
- the URL
- the TCP port
- the name of the primary site collection administrator
- the primary site collection administrator's password
To find the name of the primary site collection administrator:
- Open the SharePoint Central Administration website using the Start menu item.
- Click the Application Management tab.
- Under the SharePoint Site Management heading, click Site Collection Administrators.
- Select the name of the site collection hosting your web part from the dropdown list.
- Make a note of the account set in the Primary Site Collection Administrator box.

2. Grant permissions
The primary site collection administrator must have permission to launch an IIS worker process. To grant this permission:
- Open Administrative Tools then open Local Security Policy.
- Under Local Policies, click User Rights Assignment.
- Double-click Act as part of the operating system and add the primary site collection administrator's account.

- In the same way, double-click Impersonate a client after authentication and add the primary site collection administrator's account.
- Open a command prompt and run
gpupdate /force
to enforce the new settings. - Open Administrative Tools and go to Computer Management.
- Under Local Users and Groups, open Users.
- Double-click the primary site collection administrator's account and open the Member Of tab.
- Add the Administrators group.

The ANTS Performance Profiler 6 Service must use the primary site collection administrator's account when it starts. To configure this:
- Open Administrative Tools then open Services.
- Double-click ANTS Performance Profiler 6.2 Service.
- Click the Log On tab.
- Select This Account and enter the primary site collection administrator's username and password.
- Click OK.
- If the status of ANTS Performance Profiler 6 Service is Started, right-click the service and click Restart.

3a. Ensure that compilation will be in DEBUG configuration (IIS 7)
(Instructions for IIS 6 are below)
To set the application in DEBUG configuration in IIS 7:
- Load IIS Manager.
- Click the web application you want to profile.
- Click the .NET Compilation option.
- Under the Behavior group, set Debug to True.
Continue reading the isntructions in 4. Copy PDBs and web part DLLs to the app_bin directory, below.
3b. Ensure that compilation will be in DEBUG configuration (IIS 6)
To profile a SharePoint collection, the ASP .NET compilation must be done in DEBUG configuration. This will allow ANTS Performance Profiler to locate the source code for any web parts or other extensions you have written for the site collection. DEBUG configuration will also relax some unmanaged code restrictions that prevent profiling and stop the site from timing out.
To set DEBUG configuration, you must know the physical path to the root of the site collection website.
To find this path:
- Open Administrative Tools.
- Open Internet Information Server (IIS) Manager.
- Right-click the website containing the site collection then click Properties.
- Open the Home Directory tab.
- Note the path in the Local path box.

You must now locate and edit the web.config file for the site collection using an XML editor.
- Use Windows Explorer to navigate to the site collection root's physical path.
- Right-click the web.config file.
- Open the web.config file using Notepad. Search for the text debug.
- Change
<compilation batch="false" debug="false">
to<compilation batch="false" debug="true">
and save the file.

4. Copy PDBs and web part DLLs to the app_bin directory
If you want to be able to filter out all methods except the ones run by your code when viewing the results, you must copy the relevant files into the site's app_bin directory. To do this:
- Copy all PDB files and any web part DLLs used by your site to the Clipboard.
- Use Windows Explorer to navigate to the site collection root's physical path.
- Open the app_bin directory.
- Paste all PDB files and any web part DLLs used by your site into this directory.
Continue following the instructions in Setting up the Performance Profiler, above.
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

Using ANTS Performance Profiler
Running a profiling session