Can't profile WCF service using TCP binding

Code profiling for .NET Developers

Moderators: Luke Jefferson, StephenC, Alex.Davies, AndrewH, melvyn.harbour, Laura Morley

Can't profile WCF service using TCP binding

Postby m-a » Tue Mar 15, 2011 7:39 pm

Hi

We're running a wcf service hosted on IIS 7 listening on a fixed TCP port (809). TCP binding for this port is define under IIS.

I'm trying to make ANTS Performance Profiler (using ASP.NET web application (IIS) app type) listen on that port but it is not possible
since the port is already used by IIS.

I tried to stop the default web site prior to run ANTS but I still get the same error msg.

I can successfully start the profiler on this port (809) if I remove the TCP binding from IIS but after that my client application
can't access the wcf service anymore.

I get the following error :

"You have tried to create a channel to a service that does not support .Net Framing.
It is possible that you are encountering an HTTP endpoint."

Is there any way to profile a wcf service on a fixed tcp port ?

I'm using ANTS Performance profiler 6.2.0.13
m-a
 
Posts: 4
Joined: Tue Mar 15, 2011 6:53 pm

Postby Chris.Allen » Wed Mar 16, 2011 2:11 pm

Sorry you're having this problem. Please see
http://www.red-gate.com/supportcenter/C ... 20Profiler


for the PDF version and


http://www.red-gate.com/supportcenter/C ... 20Profiler

for the more succinct version. This should help clarify how to profile on original IIS port. if the docs are not helpful , please tell is exactly why.
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby m-a » Wed Mar 16, 2011 7:07 pm

Thanks for the response.

I followd the settings according to the first link you sent me.
I now get a different error. As soon as I launch ANTS profiler, I get this error :

"Failed to connect to target process because an exception occured:

Could not start IIS

Please check your settings and try again.

DETAILS


Could not start IIS.
RedGate.Profiler.Engine.Exceptions.CannotStartSessionException
at
m-a
 
Posts: 4
Joined: Tue Mar 15, 2011 6:53 pm

Postby Brian Donahue » Thu Mar 17, 2011 2:47 pm

Try running Performance Profiler as administrator.
Brian Donahue
 
Posts: 6668
Joined: Mon Aug 23, 2004 10:48 am

Postby m-a » Thu Mar 17, 2011 3:38 pm

Since the beginning I've always run ANTS as an administrator.
m-a
 
Posts: 4
Joined: Tue Mar 15, 2011 6:53 pm

Postby Brian Donahue » Thu Mar 17, 2011 5:42 pm

Please ensure you are NOT using "profile on original port" as per the instructions. If you are unsure if another application is using the port you want to start the application on, you can use netstat -a and check for a LISTENING status on that port.
Brian Donahue
 
Posts: 6668
Joined: Mon Aug 23, 2004 10:48 am

Postby m-a » Thu Mar 17, 2011 6:49 pm

I'm not using the "profile on original port" option.

I ran the netstat -a command, found a unused port, and tried to start ANTS on this one (port 808)

Having the following config

URL : http://127.0.0.1:808/Services/Portal.svc
Unused port : 808

gives me the same error I mentionned above (I get this error as soon as the URL port is different than 80)
m-a
 
Posts: 4
Joined: Tue Mar 15, 2011 6:53 pm

Postby Brian Donahue » Sat Mar 19, 2011 12:33 pm

Hello,

I think we have worked out the source of the error using a debugger.

When Profiler starts the w3wp.exe process, it first tries to launch w3wp.exe using the current user security context. Sometimes this fails, and it tries to launch it from the ANTS Performance Profiler 6 service, which runs as SYSTEM. If any errors occur, they happen in the service, and tries to send them through the .NET remoting channel that connects the service to the profiler program.

In this case, the actual error class was not marked as serializable, so instead of getting the actual cause of the problem, we get a serialization error. When we debugged the service, we found that the Profiler could not determine the IIS Site ID based on the URL in the address box. This was because the URL included the port that we wanted to profile on rather than the one IIS normally uses.

So it is important to note that the address you enter is the one you would normally use in IIS.

Additionally, I've found that the profile on original port option should work, but it will restart IIS and a lot of the time the restart fails because of problems with security or one of the dependent services launched by IIS failing to start. Running the Profiler As Administrator may make the process work if the Profiler trigger process can't elevate.

Rest assured I'll log a few bugs around this and try to come up with some better documentation and diagnostic steps to troubleshoot the most common IIS profiling failures.
Brian Donahue
 
Posts: 6668
Joined: Mon Aug 23, 2004 10:48 am


Return to ANTS Performance Profiler 6

Who is online

Users browsing this forum: No registered users and 0 guests