Can't profile anything

webviewwebview Posts: 11
I am trying to simply start ants to profile my local ASP.NET app (written in 1.1). I am using ANTS Profiler (registered) 2.0.

Both the ANTS profiler (service) and IIS (service) are running and my application works fine locally when not using ANTS.

Whenever I try starting it I get a dialog box with:
"There was a problem starting the profiler. Check that the ANTS Profiler service and IIS are running.

Value cannot be null.
Parameter name: address

Please check the event log for more details"

The event log has:
Unable to start profiler - exception details System.ArgumentNullException: Value cannot be null.
Parameter name: address

Server stack trace: 
   at System.Net.IPEndPoint..ctor(IPAddress address, Int32 port)
   at System.Runtime.Remoting.Channels.RemoteConnection..ctor(SocketCache socketCache, String machineAndPort)
   at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machineAndPort)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
   at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception 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.ServiceHelper.remove_Status(StatusEventHandler value)
   at RedGate.Profiler.Engine.ProfilingSession.StartProfiler()
   at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [1]: 
   at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
   at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
   at System.Windows.Forms.MethodInvoker.EndInvoke(IAsyncResult result)
   at ᐃ.ᐄ(IAsyncResult )

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    edited February 1, 2005 10:00AM
    Hello,

    Thanks for your post. I think that this must be happening when ANTS Profiler is stopping or starting IIS as part of profiling a web application. When it does this, it opens a socket connection to the website to make sure that it's been started correctly.

    I can think of two possibilities for this error: one is that the URL for the web site that you entered aas part of the profiling parameters is incorrect. The other is that your website is listening on the same port that ANTS Profiler's back-end service is listening on. That port is 8087.

    If you could please check that you are profiling a valid web application (with an address that includes the server, port, and virtual directory path) and that the site is not listening on port 8087, that should hopefully solve the problem.
  • I checked everything and things look normal. It's just a normal .NET application running on localhost on port 80, i.e.

    http://localhost/myapp/

    Going there in the browser (or VS.NET debugger) works great, never any problems.

    If I try to run ANYTHING through ANTS (e.g. sample .NET applications) I get the same error as posted above.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Can you check to see that nothing but ANTS Profiler Service is listening on TCP port 8087? First, stop ANTS Profiler Service using the Services Control Panel app. Next, open a command prompt and type
    netstat -a | find "8087"
    ...if some output is returned with a status of LISTENING, you may want to find out what program is listening on this port and shut it down.
  • Yes, I just did this and it reports that it is "LISTENING"

    TCP machinename:8307 machinename:0 LISTENING
  • Sorry for the typos. To clarify.

    I stopped the ANTS profiler service.
    Netstat didn't find anything listening on 8087
    I started the ANTS profiler service
    Netstat found something listening on 8087.
  • I have Windows XP SP2 installed. The Windows Firewall is disabled, but I do get this audit entry in my security event log (it's reporting port 2478):


    The Windows Firewall has detected an application listening for incoming traffic.

    Name: ANTS Profiler
    Path: C:\Program Files\Red Gate\ANTS Profiler\RedGate.Profiler.UI.exe
    Process identifier: 2972
    User account: tdietz
    User domain: HUBBARDONE
    Service: No
    RPC server: No
    IP version: IPv4
    IP protocol: TCP
    Port number: 2478
    Allowed: Yes
    User notified: No
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Have you got another firewall installed, such as Norton Internet Security? Windows is capable of monitoring other firewall products that report to Windows Management Instrumentation.
  • No. The firewall is disabled via a company-security policy.

    Is there anything I might need to set in IIS or ASP.NET's machine.config? It should be all stock configs right now.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello,

    I still have no idea about this. ANTS Profiler is tring to establish a socket connection to the ANTS Profiler Service and is coming up with a null value for an address, which is not explicitly named in the code because it is normally assumed to be the local machine.

    I don't suppose it would be too inconvenient to re-installl the .net Framework?
  • I finally got it working. I reinstalled .NET 1.1. (SP1) but that didn't help. After reading your description of what is going on, I checked my local 'hosts' file (\system32\drivers\etc\hosts) and noticed there was an additional mapping to 127.0.0.1 for an app I was debugging a long time ago.

    There still was the:

    127.0.0.1 localhost

    entry, but apparently having this second mapping:

    127.0.0.1 myapp.mycompany.com

    didn't work well with ANTS. After removing the second entry, the profiler seems to work now.

    Thank you for all your help!
  • Hi Webview,

    That's good news.

    I had suspected this to be the cause of the problem a few days ago, so I removed 127.0.0.1 from the hosts and lmhosts files of my test computer, rebooted, and ran profiler again, but that didn't reproduce the problem so I didn't mention it.

    I wish I would have now!
This discussion has been closed.