Print Page | Close Window

Cannot connect to IIS-hosted server with custom config

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4140
Printed Date: 29-Mar-2025 at 9:41am


Topic: Cannot connect to IIS-hosted server with custom config
Posted By: John
Subject: Cannot connect to IIS-hosted server with custom config
Date Posted: 06-May-2013 at 9:31am
Hey,
I am trying to connect from console/WPF client to IIS-hosted server with custom configuration, let's say net.tcp binding.
The client and the server define corresponding <serviceModel> sections.
The client defines the minimal <objectServer> section just for being distributed.
The server seems to be OK - I can browse to its site and I can connect via ChannelFactory to both EntityService.svc and EntityServer.svc.
However, whenever the client tries to create its EntityManger subclass, it throws InvalidOperationException with the message:
"Cannot find ObjectServer or default ServiceKey", followed by EndpointNotFoundException claiming that there was no endpoint to the URI that I DO connect via channel factory!
I carefully follow your detailed explanations here:
'http://drc.ideablade.com/devforce-2012/bin/view/Documentation/code-sample-custom-client-servicemodel' and more, but it is not working...
I tried using versions 7.1.1 and 7.1.2.



Replies:
Posted By: John
Date Posted: 07-May-2013 at 2:31am
Sorry, I had a mistake in my client's app.config.
The client endpoint's address had a similar but wrong URI pointing to another server site with different configuration.
I still don't know why my own ChannelFactory connected successfully, but never mind.
Anyway, there is still a first-chance InvalidOperationException with "Cannot find ObjectServer or default ServiceKey" message, which is thrown on debug mode when I turn on the option "Debug --> Exceptions --> Thrown".
Is this by design? It would be cleaner if no exception were thrown when a satisfying <serviceModel> configuration was supplied.


Posted By: sbelini
Date Posted: 13-May-2013 at 11:12am
John,

I'm not able to see any first-chance exception being thrown.
Could I take a look at your client/server config files?


Posted By: sbelini
Date Posted: 14-May-2013 at 3:51pm
John,

Looking back at this issue I could get the first chance exception. (the custom config plays a role here)

I'm filing a bug report so to suppress the exception.


Posted By: John
Date Posted: 21-May-2013 at 8:12am
Thanks.



Print Page | Close Window