Can't profile WCF service using TCP binding

m-am-a Posts: 5

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


  • Sorry you're having this problem. Please see ... 20Profiler

    for the PDF version and ... 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.
  • 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.


    Could not start IIS.
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Try running Performance Profiler as administrator.
  • Since the beginning I've always run ANTS as an administrator.
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    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.
  • 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 :
    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)
  • Brian DonahueBrian Donahue Posts: 6,590 New member

    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.
Sign In or Register to comment.