Error profiling ASP.NET Web application

Code profiling for .NET Developers

Moderators: StephenC, Alex.Davies, AndrewH

Error profiling ASP.NET Web application

Postby Jon Sagara » Tue Jul 14, 2009 9:17 pm

Hello,

I just downloaded the trial, and I am unable to start profiling an ASP.NET Web application.

Here are my particulars:
* OS: Windows Server 2008 SP2
* Visual Studio 2008 SP1 (.NET Framework 3.5 SP1)

My application uses a Web site that is defined in IIS7. The URL (myurl.example.com) is defined in my HOSTS file, and is not a DNS entry.

So what happens is this: in Visual Studio, I select ANTS 5 -> Profile Performance, and I get the following error message:

---------------------------
Exception while performing Profile &Performance
---------------------------
System.UriFormatException: Invalid URI: The URI is empty.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at RedGate.Profiler.AddIn.Commands.ProfileCommand.get_LaunchArguments()
at RedGate.Profiler.AddIn.Commands.ProfileCommand.RunCommand()
at RedGate.Profiler.AddIn.Five.Connect.Exec(String commandName, vsCommandExecOption executeOption, Object& varIn, Object& varOut, Boolean& handled)
---------------------------
OK
---------------------------


I tried opening Profiler itself (ANTS 5 -> Launch ANTS Performance Profiler), which brought up the Settings dialog. I selected the following options:
* Choose application type to profile: ASP.NET web application (hosted in IIS)
* ASP.NET web application (URL): http://myurl.example.com:80/
* Profiling mode: Line-level and method-level timings; all methods (most detailed)
* Default timing display: CPU
* Profile child processes: checked
* Profile on: (I tried both; I get the same exception either way)

When I clicked the Start Profiling button, I got the following exception:

Couldn't determine the IIS Site associated with URL 'http://myurl.example.com/'. Please check that the URL is serviced by the instance of IIS running on this machine
RedGate.Profiler.Engine.Exceptions.CannotStartSessionException
at bJ.Launch()
at RedGate.Profiler.Session.ProfilerSession.j()

Caused by:

Couldn't determine the IIS Site associated with URL 'http://myurl.example.com/'. Please check that the URL is serviced by the instance of IIS running on this machine
RedGate.Profiler.Engine.Exceptions.CannotStartIisSessionException
at bQ.PerformLaunch()
at bJ.Launch()

Caused by:

Couldn't determine the IIS Site associated with URL 'http://myurl.example.com/'. Please check that the URL is serviced by the instance of IIS running on this machine
RedGate.Profiler.Engine.Startup.IIS.IISException
stack trace:
at RedGate.Profiler.Engine.Startup.IIS.IIS7Utilities.a(String , Uri , Boolean , Int32 )
at RedGate.Profiler.Engine.Startup.IIS.IIS7Utilities.GetW3wpArgs(Uri url, Boolean profileOnNewPort, Int32 newPort)
at bp.StartProfilingIIS(String currentUserName, String subprocessVariableValue)
at RedGate.Profiler.Engine.Startup.IIS.IISStarter`1.StartProfilingIIS(String currentUserName, String subprocessVariableValue)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at RedGate.Profiler.Engine.Startup.IIISActuator`1.StartProfilingIIS(String currentUserName, String subprocessVariableValue)
at bQ.PerformLaunch()


Any ideas?

Thanks,

Jon
Jon Sagara
 
Posts: 1
Joined: Tue Jul 14, 2009 9:07 pm

Postby Brian Donahue » Wed Jul 15, 2009 4:27 pm

Hi Jon,

This is a well-known issue with the Profiler add-in. When you use the add-in, it checks the debugging settings for the current project to determine which URL to launch in the web server. If you put a valid url in by right-clicking the project in VS, then selecting properties, and on start options, enter a valid URL in the "use custom server" textbox.

ANTS Profiler will only profile websites running on the local computer, so any URL that you enter here (or in the regular ANTS Profiler UI) has to be resolved to the local computer by hosts, DNS, and IIS itself.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Why is this still an issue?

Postby bbirney » Mon Feb 08, 2010 7:49 pm

This seems like a good candidate for a fix. As a prospective user, I was very discouraged when my first experience with the software was an unhandled exception, followed by 45 minutes of monkeying around with VS and IIS, trying to get past the first step of the tutorial.

I am attempting to work around this limitation - it appears that you cannot use ANTS with the development web server, since providing this value in "Use Custom Server" precludes the possibility of selecting "Use Visual Studio Development Server". Have any other users found a way to use ANTS with the VS development server? I am attempting to install my site onto my local machine's stand-alone IIS and run it that way, but that breaks the normal workflow for developing in Visual Studio.
bbirney
 
Posts: 8
Joined: Mon Feb 08, 2010 7:44 pm

Screenshots

Postby bbirney » Tue Feb 09, 2010 3:01 pm

Here are two screenshots: One illustrating the issue, and the other with my current project settings for the web app in question. As you can see in the second screenshot, I have set a valid URL in the "Use Custom Server" text box. The error occurs regardless of whether the radio button for Use Custom Server or the radio button for Use Visual Studio Development Server is selected.

Please assist.

Image

Image
bbirney
 
Posts: 8
Joined: Mon Feb 08, 2010 7:44 pm

Solution

Postby bbirney » Tue Feb 09, 2010 6:21 pm

I spoke with Nick at Red Gate, and he directed me to a solution. Here it is:

1) Download this file: ftp://support.red-gate.com/patches/ants_profiler/RedGate.Profiler.Five.AddIn.dll

2) Put it in your ANTS install directory, replacing a file with the same name.

3) Restart Visual Studio.
bbirney
 
Posts: 8
Joined: Mon Feb 08, 2010 7:44 pm


Return to ANTS Performance Profiler 5

Who is online

Users browsing this forum: No registered users and 0 guests

cron