CslaLight 3.7.0 - Issue with ServiceReferences.ClientConfig

CslaLight 3.7.0 - Issue with ServiceReferences.ClientConfig

Old forum URL: forums.lhotka.net/forums/t/7227.aspx


StuartBale posted on Sunday, July 05, 2009

I've built CSLA.dll for Silverlight 3 using both the 3.6.3 and 3.7.0 codebase.

While 3.6.3 works correctly, I receive an error in 3.7.0 in WCFProxy.cs:

"Could not find default endpoint element that references contract 'WcfPortal.IWcfPortal' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element."

The error is on Line 125:
return new WcfPortal.WcfPortalClient();

Has anyone else encountered this, or have any suggestions as to why this is happening?

Thanks

RockfordLhotka replied on Sunday, July 05, 2009

Do you have a clientconfig file in your SL application? The one in the Csla project is just a placeholder - the Silverlight runtime only honors a config file if it is in your actual application.

JabbaTheNut replied on Wednesday, July 08, 2009

I am having exactly the same issue.  I also have built CSLA for Silverlight 3 using both 3.6.3 and 3.7.0.  I was successful in the 3.6.3 implementation (albeit with an unresolved async issue that I will post about separately).  3.7.0, however, threw the above mentioned error.  I am using the same ServiceReferences.ClientConfig that worked successfully in the 3.6.3 implementation.

JabbaTheNut replied on Wednesday, July 08, 2009

I resolved my problem.  The problem appears to be with the References.cs file.  I did the following and was able to both compile and successfully implement version 3.7.0 for Silverlight 3:

1.  Remove the reference to System.Windows.Controls.Data and then add back the Silverlight 3 version of System.Windows.Control.Data

2.  Replace the 3.7.0 version of the References.cs file with the 3.6.3 version (downloaded from CSLA.Net site).  This References.cs file is located under cslalightcs\Csla\Service References\WcfPortal

RockfordLhotka replied on Wednesday, July 08, 2009

Have you looked at the clientconfig file that’s in the CSLA project? I suspect Microsoft changed some WCF config options, and that may mean you need to update your clientconfig as well.

 

Rocky

 

 

From: JabbaTheNut [mailto:cslanet@lhotka.net]
Sent: Wednesday, July 08, 2009 4:08 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] CslaLight 3.7.0 - Issue with ServiceReferences.ClientConfig

 

I am having exactly the same issue.  I also have built CSLA for Silverlight 3 using both 3.6.3 and 3.7.0.  I was successful in the 3.6.3 implementation (albeit with an unresolved async issue that I will post about separately).  3.7.0, however, threw the above mentioned error.  I am using the same ServiceReferences.ClientConfig that worked successfully in the 3.6.3 implementation.

RockfordLhotka replied on Friday, July 10, 2009

I have addressed this issue, and the 3.7 beta I just put online should work fine.

StuartBale replied on Friday, July 17, 2009

Thanks Rocky - i've also noticed that it's necessary to set the correct contract in the client endpoint ... previously i had:
contract="Csla.WcfPortal.IWcfPortal"
i changed to:
contract="WcfPortal.IWcfPortal"
and it now works ok.

RockfordLhotka replied on Friday, July 17, 2009

I wonder why? I haven't had to do that in my projects.

Roy Ogborn replied on Wednesday, July 29, 2009

Same issue here.

In fact my project had been running on 3.7.0 but had resigned my copy of the 3.7.0 CslaLight projects back to using Rocky's original snk file to keep consistency with a co-developer on the same project and then recompiled.

Stuart, thanks for your post! Removing the "Csla." prefix in my ServiceReferences.ClientConfig endpoint contract on the Silverlight app solved the problem.

Strange.

Roy

Copyright (c) Marimer LLC