Silverlight RIA Services Complex Type Error On Server
We are trying to run a Silverlight 4.0 with RIA Services SP1 on an older server without SP1. We copied all of the DLL to a local BIN folder, Copy Local is set to True AND Specific Version is set to True yet we are still getting a "complex type" error belo开发者_如何学Gow.
WebHost failed to process a request.
Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/7339810
Exception: System.ServiceModel.ServiceActivationException: The service '/Linebacker/Services/FCSAmerica-Linebacker-Web-DomainServices-LinebackerDomainService.svc' cannot be activated due to an exception during compilation. The exception message is: Operation named 'SearchCustomers' does not conform to the required signature. Return types must be an entity, collection of entities, or one of the predefined serializable types.. ---> System.InvalidOperationException: Operation named 'SearchCustomers' does not conform to the required signature. Return types must be an entity, collection of entities, or one of the predefined serializable types.
at System.ServiceModel.DomainServices.Server.DomainServiceDescription.ValidateMethodSignature(DomainOperationEntry method)
at System.ServiceModel.DomainServices.Server.DomainServiceDescription.AddInvokeOperation(DomainOperationEntry method)
at System.ServiceModel.DomainServices.Server.DomainServiceDescription.Initialize()
at System.ServiceModel.DomainServices.Server.DomainServiceDescription.CreateDescription(Type domainServiceType)
at System.ServiceModel.DomainServices.Server.DomainServiceDescription.<>c__DisplayClass8.<GetDescription>b__7(Type type)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at System.ServiceModel.DomainServices.Server.DomainServiceDescription.GetDescription(Type domainServiceType)
at System.ServiceModel.DomainServices.Hosting.DomainServiceHost..ctor(Type domainServiceType, Uri[] baseAddresses)
at System.ServiceModel.DomainServices.Hosting.DomainServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses)
at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
--- End of inner exception stack trace ---
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)
This is what our code looks like in the domain service...its a wrapper around a WCF call not an Entity object.
[Invoke]
public IEnumerable<Customer> SearchCustomers(string searchValue)
{
return new List<Customer>();
}
Do we need to install SP1 on the Host Server? Will this impact older versions of Silverlight that are running there? Are we missing an attribute or something?
We have basically copied every dll local to the hosts bin folder and referenced the same in a library folder on our development machines.
Things run fine on our developer machines but not on the Server.
Thanks Qui_Jon
I've had much the same issue attempting to use a WCF RIA Service using ComplexObjects on a server which didn't have WCF RIA Services 1.0 SP1 installed on it. The short answer to your question is that yes, you will need to install WCF RIA Services V1.0 SP1 on the server. It shouldn't impact on anything else running there.
When you run the installer, it might complain that it can't find Visual Studio. If so, quit the installer, open a Command Prompt, change to the directory containing the RiaServices.msi
installer and run the following command:
msiexec /i RiaServices.msi SERVER=TRUE
So here was the problem.
We had built and were running Complex Types with RIA with no issues on our local development machines which had RIA SP1.
Our deployment wrapped all of these DLL and deployed them to IIS on our Development Web Server and then we got the error that it must be a supported type like Entity.
So we looked in the GAC on the Deveopment Server and the OLD version of RIA was installed and in the GAC and it has the same version that SP1 has that were were deploying with our IIS install.
Thus the GAC was over-riding our DLL and we were never referencing the SP1 dlls were were deploying with our solution.
Since we DONT want to have to install RIA on our web servers and this was a "junk" install of the original RIA Services we just uninstalled it and then our deployed SP1 dll were correctly referenced and the problem was fixed.
The OTHER solution would have been to install RIA SP1 with the command line options shown above.
Thanks for the response everyone...
精彩评论