SteveC posted on Friday, October 16, 2009
I have been following the
tutorial for Csla Light and building a proof of concept app as I go along. I am using Csla 3.7 and Silverlight 3. I am running everything locally on my laptop, using Cassini. My ASPNET web project contains both a clientaccesspolicy.xml and crossdomain.xml. My problem is that when I run the application I get the following error:
CommunicationException was unhandled by user code
The remote server returned an error: NotFound.
My solution is structured as follows:
- CslaSilverlight : Silverlight Project
- CslaSilverlight.Client : Silverlight Class Library
- CslaSilverlight.Server : .NET Class Library
- CslaSilverlight.Web : ASPNET Project to host the SL app
In my silverlight application, my ServiceReferences.ClientConfig reads as follows:
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IWcfPortal" maxBufferSize="65536"
maxReceivedMessageSize="65536" receiveTimeout="10" sendTimeout="10">
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:3405/WcfPortal.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWcfPortal"
contract="Csla.WcfPortal.IWcfPortal" name="BasicHttpBinding_IWcfPortal" />
</client>
</system.serviceModel>
</configuration>
In my ASPNET web application, my WcfPortal.svc file is as follows:
<%@ ServiceHost Language="C#" Debug="true" Service="Csla.Server.Hosts.Silverlight.WcfPortal" CodeBehind="WcfPortal.svc.cs" %>
I have my ASPNET web application set to use port 3405. When I use Web Development Helper to track the calls I get the following:
http://localhost:3405/CslaSilverlightTestPage.aspx
http://localhost:3405/Silverlight.js
http://localhost:3405/ClientBin/CslaSilverlight.xap
http://localhost:3405/WcfPortal.svc
There is no detail for this last call, if I try to view the detail I get an error.
If I try to re-add the Service Reference to the Silverlight app using Visual Studio's service discovery tool, I get the following:
An error occurred while attempting to find services at 'http://localhost:3405/WcfPortal.svc'
Details:
The type 'Csla.Server.Hosts.Silverlight.WcfPortal', provided as the Service attribute value in the ServiceHost directive could not be found
I'm pretty much spinning my wheels now, having tried lots of things with no success, googled extensively and looked at all the sample apps. Any ideas??