Question

I have a very simple sample silverlight application. I added a domain service to it with an entity model that has one entity. The client app simply loads all rows in the entity at startup. When I run this on my development box, it works as expected. However, when I move it to our test server I get an exception saying that the method I am calling cannot be found (Load operation failed for query 'GetCTCStation'. The remote server returned an error. NotFound.). When I inspected the client/server communication more closely with Fiddler I found out that the request is going to http://[server url]/ClientBin/SilverlightApplication7-Client-Web-CTCService.svc/binary. I added the domain service to the root of the web project, so I don't understand why the client is looking for it in the ClientBin directory. It's obviously not there. What am I doing wrong here? I have never had any issues with July preview version of RIA.


It is relative, but that is handled in the Generated_Code file automatically. And there is nothing in the webconfig to configure. I used default settings when creating a domain service. I tried explicitly setting the uri when instantiating the service and same exception occurred.

Was it helpful?

Solution

After a long struggle and trying out many different options I finally found the solution. This post was the key:

Basically, some dll's were not inluded in the bin folder when publishing the project. Make sure under References that the following dll's are setup correctly (Make sure that System.ComponentModel.DataAnnotations is pointing to C:\Program Files\Microsoft SDKs\RIA Services\v1.0\Libraries\Server\System.ComponentModel.DataAnnotations.dll):

System.ComponentModel.DataAnnotations and every dll that starts with System.Web needs to have "Copy Local" set to true.

Build the project and publish again. This fixed the problem for me.

I would like to thank everyone that contributed to the solution of this issue (in this thread and others).

OTHER TIPS

If you inspect the error on that service request (which is normal the way you are seeing it), what does the contents in Fiddler say? NotFound is generit in the plugin, but fiddler is likely showing you an HTTP 500 or something with some more detail in the response body.

1) What IIS are you deploing on? If < 7 You need Hotfix

2) Include all your RIA assemblies (Set Copy Local => True) Including:

System.Web.Ria

System.Web.DomainServices. (there 4 of them depending on what you are using)

3) This can be a result of your node in your ASPNET application being set to Windows, but your site being set to Anonymous in IIS. For most, simply changing node to mode=”Forms” will remove this error and allow you to continue. For others, if your IIS configuration is set to use both Integrated Auth as well as Anonymous, you’ll want to uncheck one of them in the Directory Security setting for the site in IIS management console.

Microsoft recommends on MSDN that Ria Services be installed on the server.

It is recommended that RIA Services be installed on the Web server that will host your application.

There is a trick here that will probably have seen most people shy away from this solution. The installation will list a number of prerequisites by default that you would not usually want to install on the server.

Prerequisites Check

The following required components are missing:

  • Microsoft Visual Studio 2010 or newer or Visual Web Developer 2010
  • Express Microsoft Silverlight 4 Developer Runtime or newer Microsoft
  • Silverlight 4 SDK or Microsoft Silverlight 5 SDK

Running the installation with the command line argument SERVER=TRUE will bypass this check.

msiexec /i RiaServices.msi SERVER=TRUE

I would also recommend that you use this solution as it does not require special configuration for a specific set of dlls which may change in future versions. Also, the publish process will be slightly faster because these files will not be included.

Note also that you can use the Web Platform Installer to install Ria Services on a Server using the 'WCF RIA Services Server install for .Net Framework 4.0' which has the same effect as the SERVER=TRUE switch. Unfortunately though, this is version 1 only and is missing service pack 2.

In my case solution was to set "Copy Local" Property of following assemblies from WebSite's References Folder to "True":

System.ComponentModel.DataAnnotations  
System.ServiceModel.DomainServices.EntityFramework  
System.ServiceModel.DomainServices.Hosting  
System.ServiceModel.DomainServices.Hosting.OData  
System.ServiceModel.DomainServices.Server  
System.Web.ApplicationServices  
System.Web  
System.Web.Extensions  
System.Web.Mobile  
System.Web.Services

If all is correct after next rebuilding those assemblies will be copied to bin folder of your project.

What's good any handy configuration of IIS 7 I didn't perform.

Ran into this problem as well (RIA returns "Not Found"), but in my case it ended up being that my query was returning more rows than allowed via maxitemsinobjectgraph. My temporary resolution was to add .Take(5000) to reduce the result set, but a permanent resolution requires extending the maxitemsinobjectgraph as referenced below. Hope this helps someone else out...

<behaviors>    
 <behavior name="MyServiceBehavior">        
  <dataContractSerializer maxItemsInObjectGraph="3" />    
 </behavior>
</behaviors>

Keep in mind that the default value is Int32.MaxValue or 2,147,483,647

MSDN - maxItemsInObjectGraph

MSDN - Int32.MaxValue

Did you check the address portion of your binding configuration? It looks like it is using a relative address.

For me , it was that the authentication was not set to "Anonymous" in IIS. I used Fiddler to get the generated RIA SCV URL and then opened the URL in a browser. The message was quite explicit.

I just had to allow anonymous access, restart the application pool and everything was working as expected.

WCF RIA Services VS 2008 deployment errors

There are many nice postings on the net and the best one seems to be here (Thanks Tim)

Although all the postings I found were useful in some way, the final solution in my case was the inappropriate DB connection string. Although the VS generated DB string worked fine within VS, I couldn’t deploy it to my QA server until I trimmed it to be like this:

add name="myEntities" connectionString="metadata=res://*/ReviewsModel.csdl|res://*/ReviewsModel.ssdl|res://*/ReviewsModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=dataSource;Initial Catalog=intitalCatalog;User ID=userID;Password=password;&quot;" providerName="System.Data.EntityClient" 

WCF RIA Services VS 2008 deployment errors Here is the solution you are searching for download example and check your self live WCF RIA (Vs2008) service.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top