views:

224

answers:

1

I am having difficulty deploying RIA services/Silverlight 3 to a staging environment.

Here is my situation: 1) I am using RIA for authentication. This works fine on both my development machine and in the staging environment.

2) I created a custom LinqToEntities RIA service to get data from the database into my application. This service works fine when I do a local build, but does not work on the staging server.

  • The server side RIA code never gets called when the client makes a call to it.
  • The RiaContext appears to be initialized ok, i.e. it does not throw an exception.
  • I use code sililar to Context.Load(qry); to put data into the entities. The LoadOperation's complete event fires, but no data was loaded, the serverside methods were never called.

Any ideas on what may be wrong?

+1  A: 

I would check to make sure that you have:

  1. The correct connection string in your web.config.
  2. The application is configured to run under a service account that has permissions to access the database.

Your Context.Load should be passing a completed event handler and in that handler you chould check that the LoadOperation.HasError is false. There will be no exception thrown if something went wrong, you have to explicity check for the error.

Bryant
Thanks for the response. I get this in the LoadOperation.Error.Message: "Exception of type 'System.Windows.Ria.Data.EntityOperationException' was thrown."My database is Oracle and I am using DevArt components to get Entities. So I don't think that the error has anything to do with the database configuration. Any other suggestions on how what could be throwing the error? The code work on the dev machine but not when deployed to the staging server.
Gus
You should check the inner exception on that exception in the Error property. If you can't see an inner exception try this fix: http://blog.davidyack.com/journal/2009/9/10/ria-services-finding-the-innerexception.html
Bryant
Just an update -- I was able to fix the problem by tracking down the inner exception. I was only able to do this when running IE on the server and attaching to that process. Turns out that I needed to install more that just the required runtime for my 3rd party ORM tool on the server. Thanks again for the help.
Gus