Red Gate forums :: View topic - Can't profile WCF service using TCP binding
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Performance Profiler 6
ANTS Performance Profiler 6 forum

Can't profile WCF service using TCP binding

Search in ANTS Performance Profiler 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
m-a



Joined: 15 Mar 2011
Posts: 4

PostPosted: Tue Mar 15, 2011 7:39 pm    Post subject: Can't profile WCF service using TCP binding Reply with quote

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
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 591

PostPosted: Wed Mar 16, 2011 2:11 pm    Post subject: Reply with quote

Sorry you're having this problem. Please see
http://www.red-gate.com/supportcenter/Content?c=knowledgebase%5cANTS_Profiler%5cKB200809000304.htm&p=ANTS%20Profiler


for the PDF version and


http://www.red-gate.com/supportcenter/Content?c=ANTS_Performance_Profiler%5chelp%5c6.2%5capp_wcf_in_iis.htm&p=ANTS%20Performance%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.
Back to top
View user's profile Send private message
m-a



Joined: 15 Mar 2011
Posts: 4

PostPosted: Wed Mar 16, 2011 7:07 pm    Post subject: Reply with quote

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 ..Launch()
at RedGate.Profiler.Session.ProfilerSession.?()

Caused by:

Could not start IIS.
RedGate.Profiler.Engine.Exceptions.CannotStartIisSessionException
at ..()
at ..Launch()

Caused by:

Could not start IIS.
RedGate.Profiler.Engine.Exceptions.CannotStartIisSessionException
at ?.?.??()
at ..??( )
at ..()

Caused by:

Type 'System.Xml.XmlNode' in Assembly 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.
System.Runtime.Serialization.SerializationException
stack trace:
at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type)
at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
at System.Runtime.Remoting.Channels.CoreChannel.SerializeBinaryMessage(IMessage msg, Stream outputStream, Boolean includeVersions)
at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.SerializeResponse(IServerResponseChannelSinkStack sinkStack, IMessage msg, ITransportHeaders& headers, Stream& stream)
at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)
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)

Thank you[/img]
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6667

PostPosted: Thu Mar 17, 2011 2:47 pm    Post subject: Reply with quote

Try running Performance Profiler as administrator.
Back to top
View user's profile Send private message
m-a



Joined: 15 Mar 2011
Posts: 4

PostPosted: Thu Mar 17, 2011 3:38 pm    Post subject: Reply with quote

Since the beginning I've always run ANTS as an administrator.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6667

PostPosted: Thu Mar 17, 2011 5:42 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
m-a



Joined: 15 Mar 2011
Posts: 4

PostPosted: Thu Mar 17, 2011 6:49 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6667

PostPosted: Sat Mar 19, 2011 12:33 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group