| Author |
Message |
m-a
Joined: 15 Mar 2011 Posts: 4
|
Posted: Tue Mar 15, 2011 7:39 pm Post subject: Can't profile WCF service using TCP binding |
|
|
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 |
|
 |
Chris.Allen
Joined: 12 Mar 2009 Posts: 443
|
|
| Back to top |
|
 |
m-a
Joined: 15 Mar 2011 Posts: 4
|
Posted: Wed Mar 16, 2011 7:07 pm Post subject: |
|
|
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 |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6346 Location: Red Gate Software
|
Posted: Thu Mar 17, 2011 2:47 pm Post subject: |
|
|
Try running Performance Profiler as administrator. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
m-a
Joined: 15 Mar 2011 Posts: 4
|
Posted: Thu Mar 17, 2011 3:38 pm Post subject: |
|
|
| Since the beginning I've always run ANTS as an administrator. |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6346 Location: Red Gate Software
|
Posted: Thu Mar 17, 2011 5:42 pm Post subject: |
|
|
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
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
m-a
Joined: 15 Mar 2011 Posts: 4
|
Posted: Thu Mar 17, 2011 6:49 pm Post subject: |
|
|
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 |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6346 Location: Red Gate Software
|
Posted: Sat Mar 19, 2011 12:33 pm Post subject: |
|
|
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
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
|