Cannot Profiler Asp.net Apps - Ants Service Hangs

Ants system: Ants 2.7
OS : windows xp sp2
IIS 5.1
Asp.net 1.1 (although 2.0 is installed on machine) - app IS configured as a 1.1 app.

:evil:

5 months ago we got a trial of ants profiler and took it through it's paces. Now we just bought 5 licenses and tried to profile the same app on the same machine and the StartingService hourglass never dies - hangs. The only way out is killing the AntsProfiler service process.
Windows services and windows applications can be profiled but web apps cannot. We tried even just a simple web page and the service start up hangs. if we manually re-start the service during the hang then we get the following error in the event log:
Unable to start profiler - exception details System.Exception: Couldn't restart the service (timeout)

Server stack trace:
at RedGate.Profiler.Engine.ProfilingSession.StartProfiler()
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.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [0]:
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 _3._4(IAsyncResult )

Some other errors we have seen (we have tried many things and the symptom described above is always true - the follwing errors could have been received doing very bad things to processes etc.)

Service cannot be started. System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at System.Net.Sockets.TcpListener.Start(Int32 backlog)
at System.Net.Sockets.TcpListener.Start()
at System.Runtime.Remoting.Channels.ExclusiveTcpListener.Start(Boolean exclusiveAddressUse)
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.StartListening(Object data)
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupChannel()




Unable to start profiler - exception details System.NullReferenceException: Object reference not set to an instance of an object.

Server stack trace:
at RedGate.Profiler.Engine.ProfilingSession.StartProfiler()
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.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Comments

  • Hi there,

    sorry that this is causing you problems. The only obvious problem that springs to mind is that you are already using the port that ANTS Profiler Service tries to use for communication. ANTS Profiler uses port 8087 and will not work if you are using this for another app.

    Thanks,

    Tom Harris

    Red Gate Software
  • we thought of that and used sysinternals cports to ensure that port was not being used.
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    I hope this isn't too obvious, but it may be a good idea to try disabling any anti-virus/network security or personal firewalls from the computer. The error message is pretty plain that there is a communication problem with the port that the ANTS Profiler Service uses. Either this port is blocked off, or another application already has a listener set up on it. The netstat utility can show you the current port usage. If you stop the ANTS Profiler Service, then open a command prompt and type netstat -an and see that another application is listening on port 8087, then you can use netstat to get the PID of the application and cross-reference that with the information in task manager to kill off the relevant process.

    The ANTS Profiler Service is the component that needs to start in order to profile ASP .NET, COM+, and service applications. So it does make sense that you can still profile a desktop application.
  • sysinternals cports application is built on top of netstat...so yes we tried that.
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Could it be a problem with the TCP/IP stack in general? Can you ping 127.0.0.1? Does ping localhost resolve to 127.0.0.1 and is there a response?
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    It just grabbed me that you can profile anything but websites.

    What platform is this on? Is it a server-class OS? You may want to check your websites to make sure none of them answer port 8087, even the inactive ones.
  • as stated in the original post:

    Ants system: Ants 2.7
    OS : windows xp sp2
    IIS 5.1
    Asp.net 1.1 (although 2.0 is installed on machine) - app IS configured as a 1.1 app.

    Yes 'localhost' resovles to 127.0.0.1...What you may want to look at is an older post you made about framework 2.0 and 1.1 on the same box EVEN when the asp.net app is configured as 1.1...Apparently you had some trouble with this before and the people reporting the problems never had (or reported) a resolution. This of course would be a BIG deal breaker. ALL 200 developers are running both.
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Good point.

    It may help to configure the default version of ASP .NET for the default website to be version 1.1. If ANTS cannot get the information out of the metabase, it defaults to the default version (previously pre 2.5 it defaulted to the newest version). You can use the ASP .NET tab of the website configuration (2.0) or the aspnet_regiis.exe utility from the relevant Framework installation folder.

    This issue doesn't manifest itself this way, however. It normally gives you an 'application has not loaded the .net framework' message.
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Have you got assembly trusts implemented on your network? Maybe the Red Gate .NET assemblies are not trusted for remoting purposes?
  • Hi there,

    your problem is unrelated to the issue of profiling ASP.NET apps when both versions of .NET are installed. For your information AP 2.7 fixes that issue. I have asked Brian to follow up via email with another suggestion though.

    Regards,

    Tom
Sign In or Register to comment.