×

First time here?

You are looking at the most recent posts. You may also want to check out older archives. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS or email. Thank you for visiting!

UPDATE: Please read the updated information on RIA Services deployment and troubleshooting on MSDN..

So you’ve been playing around with Silverlight and WCF RIA Services (the artist formerly known as .NET RIA Services) and you are ready to deploy.  You’ve been living in your happy Visual Studio environment, perhaps even relying on the built-in web server (a.k.a. Cassini) to serve up your pages/XAP to test.  All has been well, you’ve done your testing and you are ready to publish to your server.  You compile one last time and then right-click in Visual Studio on the web project and click Publish.  You push to your IIS endpoint or via FTP and the files deploy.  Sweet!  Now you go visit your site.  And it doesn’t work.  WTF?

I’ve been getting some emails on RIA Services deployment gotchas and thought I’d take a stab at explaining some of the deployment nuances. 

First it should be said that there is no greater supplement than having your dev environment match as close as possible to your ending target production environment.  If you are using IIS6 to host your final application, then it would be ideal that it is also your development/test environment.  I know this isn’t always possible for everyone, but if it is, make the effort and save yourself some time in the long run.

What is described below are some things you might run into.  Not everyone will…some will not hit any of these.  But hopefully if you do, this will be some insight.

Deploying the RIA libraries – to bin or not to bin

Your first error you may run into is assembly loading errors in your ASP.NET application.  Perhaps it says that it cannot locate or load System.Web.Ria assembly?  And here you thought the Publish command was going to deploy those for you, didn’t you (note: so did I).  Well, they aren’t.  You can do two things here.

First, you can “bin deploy” if you want.  That term means that you would deploy any non-core framework assemblies in your web applications /bin directory, making them locally available to the web application.  If you want to go this route, you can.  You have to manually go into your references in your web application and change the Copy Local property on some assemblies:

Change Copy Local Property image

The assemblies you would want to do this on (depending on what you have referenced) would be:

  • System.Web.Ria
  • System.Web.DomainServices.* (there 4 of them depending on what you are using)
  • Microsoft.RiaServices.Tools UPDATE: this assembly only required for design-time experiences

Once you do that, on your next compile, these assemblies would be copied to your bin directory and then the subsequent Publish action would also push those to your server.

The second option you have is to install the RIA Services server libraries on the server in the Global Assembly Cache (GAC).  You may have tried this already and run the RiaServices.msi installer on your server and received the warning that you are missing Visual Studio and all sorts of tools.

And then you walked away and went the bin-deploy route.  Well open up a command prompt and run this instead:

   1: msiexec /i RiaServices.msi SERVER=TRUE

And the server assemblies for RIA Services will be installed into the GAC for all to enjoy.  The advantage this has is that it becomes easier to service if you have one set of assemblies to update versus a few /bin deployed applications scurried all over the place.

HTTP Scheme violation and IIS host-headers

Now you run your application and you get this exception:

This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection.
Parameter name: item

Now you’re starting to wish your development environment mirrored your deployment environment aren’t you? :-)  This lovely error message will leave you wondering what is going on for a while if you didn’t know what it meant.  I mean, it’s completely descriptive isn’t it?  Of course not.

If you are getting this, you are likely running Windows 2003 server (IIS6) and are using host-headers in IIS. 

NOTE: Host headers in IIS allow you to leverage a single IP address, but have separate web sites that respond to different hostname requests.  This information is usually provided in the IIS management console and is stored in the IIS metabase.

If this isn’t you, or you aren’t controlling your server, I’m guessing you are in a shared hosting environment.

NOTE: Full trust is required for RIA Services.  UPDATE: Partial trust is supported for .NET4/VS2010, full trust requirement is only for .NET 3.5/VS2008.

Either way, what you are seeing is a limitation of Windows Communication Foundation (WCF) under .NET 3.x.  There are a few things you can do here.

If you are running .NET 3.0 (well, you likely aren’t running RIA Services then are you) – but here’s some information on creating your own ServiceHostFactory…which isn’t really an option here.

If you are running .NET 3.5 (more likely), and can get to your web.config setting, you can add this setting:

   1: <system.serviceModel>
   2:     <serviceHostingEnvironment aspNetCompatibilityEnabled="true">
   3:         <baseAddressPrefixFilters>
   4:             <add prefix="http://some.url.here.that.matches.a.host.header"/>
   5:         </baseAddressPrefixFilters>
   6:     </serviceHostingEnvironment>
   7: </system.serviceModel>

Note that the prefix you are using must match the base URI of where your DomainService will be at as well as it must exist as a mapped host-header for the site.  More information available here.

if you are running .NET 4, you may not run into this issue, but there may be an optional opt-in configuration you will have to do when .NET 4 releases.

UPDATE: HttpModule for DomainService

Perhaps one thing that I assumed was that you’d be pushing the web app completely.  But what if you already have a web.config and you aren’t pushing that over there.  Well, pay attention to the web.config of a RIA Services created project.  You’ll see an HttpModule set up (this one is from VS2010, but will be similar, just version numbers different):

   1: <httpModules>
   2:     <add name="DomainServiceModule" type="System.Web.Ria.Services.DomainServiceHttpModule, 
   3:         System.Web.Ria, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
   4: </httpModules>

If you don’t have this, then you might see some weirdness.  You see, for the default deployment, the service is handled through this module.  You may have noticed that there are no physical .SVC files in your web app.  If you look with Fiddler at your Silverlight/RIA Services application in action you’ll see something like /ClientBin/Your-Namespace-Here-Method.svc/binary.  This is actually interpreted by the module to map the request.

If you wanted to generate a physical file yourself, you can do that and the request would be processed there versus through the virtual SVC file generated.  You can read about this in Saurabh’s post.

Multiple Authentication Schemes

Okay, now you run it again and you get a message about it not supporting multiple authentication schemes and that you may have.  The message may look like this:

IIS specified authentication schemes 'IntegratedWindowsAuthentication, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used.

This can be a result of your <authentication> node in your ASPNET application being set to Windows, but your site being set to Anonymous in IIS.  For most, simply changing <authentication> 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.

Install the Hotfix (XP, Vista, Windows 2003)

As noted on the RIA Services information page, if you are not running Windows 7 or Windows 2008 R2, you need to install a Hotfix.  Some people haven’t seen this note, so be sure if you fall in that category that you grab the appropriate hotfix for your architecture and run it.  UPDATE: This hotfix is only needed if you are using VS2008.

Essential Tools

So how can you troubleshoot all these things?  Some wondered where I was able to get the error messages, when their response errors in Silverlight were just showing NotFound.  I’ve said this again with regard to debugging services, especially cross-domain stuff, that if you aren’t using an HTTP diagnostic tool you are hurting your productivity in debugging.  I use Fiddler.  I used to use Web Development Helper a lot more, but have run into some problems with it registering in IE and Fiddler has finally got rid of all nuances that bothered me with it.  Some others have used Charles proxy which I’ve heard is really great, but requires Java if you don’t have it.  Any one of these tools can provide invaluable debugging information to help triage your issue.  Sometimes the HTTP response code isn’t the full story and the response body will help tremendously.

NOTE: If you are using Fiddler for http://localhost debugging, you may have seen some challenges.  In the URL, change to http://127.0.0.1./site – noting the trailing “.” after the IP address.  Example: http://127.0.0.1.:12345/MyApp – this will trigger Fiddler to monitor those requests as well.

For WCF binary encoding messages, be sure to download WCF Binary-encoded message inspector if you are using Fiddler…it’s awesome (hat tip to Dan Wahlin for the tip).

Summary

I suspect anyone running into these issues above is likely using Silverlight 3/VS2008 and deploying to an IIS6 instance.  Truly this is where the issues might manifest themselves.  When WCF RIA Services comes out of beta/ctp status and releases next year, the development story will be that of Silverlight 4 and .NET 4 on the server.  As noted above, these WCF issues (with host-headers) are solved with .NET 4 on the server, so this post will be useless when the bits release.

I hoped by posting this though, that some in the interim might find some better troubleshooting tips with regard to the shared hosting scenario mostly.  I personally ran into a few of these myself on my own dedicated server that uses host-headers (but is still full trust), so I thought others might benefit from the steps that I went through to get my RIA Services application deployed on a server.

Hope this helps.


This work is licensed under a Creative Commons Attribution By license.


12/10/2009 3:00 PM | # re: Deploying your Silverlight and WCF RIA Services application
Thank you! Thank you! Thank you! Thank you! Thank you! I've been struggling with this for a week now! You rock man!
12/10/2009 3:01 PM | # re: Deploying your Silverlight and WCF RIA Services application
I have been struggling with deployment pretty much all afternoon. I have followed your steps and still am receiving an error. My server is IIS7. I just upgraded the application from the July Preview to the latest WCF RIA Services. Here is the error.

Load operation failed for query 'GetGreetingByGUID'. [HttpWebRequest_WebException_RemoteServer]
Arguments:NotFound
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See go.microsoft.com/.../

at System.Windows.Ria.OperationBase.Complete(Exception error)
at System.Windows.Ria.LoadOperation.Complete(Exception error)
at System.Windows.Ria.DomainContext.CompleteLoad(IAsyncResult asyncResult)
at System.Windows.Ria.DomainContext.<>c__DisplayClass17.<Load>b__13(Object )

Fiddler is showing an error on the request: holiday.farreachinc.com/.../binary
"The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."

Any help would be appreciated!

12/10/2009 3:04 PM | # re: Deploying your Silverlight and WCF RIA Services application
Chris -- so your fiddler trace shows the real story -- is the response code HTTP 500? Basically the service endpoint is sitting behind an invalid request -- perhaps an error on the server? Can you access that URL (shown in Fiddler) directly?
12/10/2009 3:11 PM | # re: Deploying your Silverlight and WCF RIA Services application
The Fiddler response code is 404. Am I missing something in a config file?
12/10/2009 3:14 PM | # re: Deploying your Silverlight and WCF RIA Services application
Chris -- something seems wrong with the service side of things. You'll have to go digging on the server to see why that is not responding. Hard for me to tell otherwise. That's a standard IIS message -- you'll have to check settings to see what might be conflicting, etc.
12/10/2009 3:27 PM | # re: Deploying your Silverlight and WCF RIA Services application
Thanks for your help. I'll do some more investigation and post what I find.
12/10/2009 3:40 PM | # re: Deploying your Silverlight and WCF RIA Services application
Tim, thanks so much for consolidating all of this information into one place. I am struggling right now with the deploy process and even after reading through your post I, like Chris, am finding that no WCF service lives at the endpoint. I know Chris is in IIS 7 but I am in IIS6 so we probably are having different issues. I have no clue where to go from here to find out why the service isn't running.

I am concerned with this statement: "the development story will be that of Silverlight 4 and .NET 4 on the server" Are you implying that WCF RIA Services is not going to try to support .NET 3.5 on IIS 6 servers? I spoke with our support guys today and while roughly 40% of our customers have a Server 2008 / IIS 7 box somewhere in their environment, only 3% of them are using that setup to run our software. If the WCF RIA Services team isn't interested in supporting Server 2003 / IIS 6 environments then I am afraid we are going to have to roll back all of the RIA work we have done so far. I suspect we aren't the only team that will have to back away if that's the story going forward. Server upgrades happen at a much slower rate than desktop upgrades... at least out here in the real world! :)

Thanks again for the great article... it needed to be written!

- Matt
12/10/2009 4:01 PM | # re: Deploying your Silverlight and WCF RIA Services application
Matt -- if you are looking for a physical .SVC file it isn't there -- RIA Services works through an HttpModule factory.

When RIA Services releases it will be a .NET4 story.
12/10/2009 4:21 PM | # re: Deploying your Silverlight and WCF RIA Services application
;) Yeah.. I figured that out the hard way yesterday! When I say the service doesn't exist, I mean if I navigate to it, I get a 404. I am using the pattern posted by Saurabh Pant on his blog to figure out where the .svc should be. When I navigate to where it should be, I get a "resource not found" error.

12/10/2009 4:24 PM | # re: Deploying your Silverlight and WCF RIA Services application
Matt -- have you looked at a fiddler trace to see what the real underlying message is?
12/10/2009 4:24 PM | # re: Deploying your Silverlight and WCF RIA Services application
also there is the endpoint name problem....
the server will return the windows server name and not the public host name.
can be a pia to find out how to tell wcf / iis to use the right name!
12/10/2009 4:35 PM | # re: Deploying your Silverlight and WCF RIA Services application
Tim, I am not sure what you mean by the "real underlying message". The header I am getting back is "HTTP/1.1 404 Not Found" which is what the browser is reporting as well.
12/10/2009 4:38 PM | # re: Deploying your Silverlight and WCF RIA Services application
Matt - 404/NotFound is what we use when *any* failure happens. Most of the time it isn't really a 404. Sounds weird, I know. But if you use fiddler to see the *actual* http request/response you may see an HTTP 500, etc. and able to look at the response headers/body. Use a tool like fiddler to see the network traffic and see what the trace is.
12/10/2009 4:58 PM | # re: Deploying your Silverlight and WCF RIA Services application
Tim... I posted a response but it got flagged as Spam. I am guessing because it contained the actual XML from Fiddler. In a nutshell, I have been using Fiddler for all of this and 404 is really what I am getting back.
12/10/2009 5:42 PM | # re: Deploying your Silverlight and WCF RIA Services application
I responded too and I got flagged as spam. I hope it went through.
12/11/2009 4:58 AM | # re: Deploying your Silverlight and WCF RIA Services application
Tim, thank you very much for your post.. i was beginning to think that i was doing something really wrong because there is almost no information about IIS deployment of RIA Services. I thought that it was something so simple that it wasn't even documented.
Well, seems like it's not.
I'm also having problems with the deployment of a Silverlight app using RIA Services on IIS 7.. just like almost everyone writing here, i get 404.0 error...
i started getting this error when i tried to publish an app that was originally built with RIA Services CTP. Then, to be sure that "it wasn't me" i started a new project and tried to publish it to IIS. Same 404 error, works great with DevServer.

One thing i notice is that using DevServer i could use the app normally and the "svc" response by using:

http://localhost:52878/IISTestTestPage.aspx#/Home
localhost:52878/...rary1-Web-DataDomainService.svc

With IIS, i try to use these URLs:

nc-rs-desenv05:100/IISTestTestPage.aspx#/Home
nc-rs-desenv05:100/...y1-Web-DataDomainService.svc

But both of them gives me 404 on the RIA Services....
Using fiddler i noticed that the "svc" request is made to "/ClientBin/RIAServicesLibrary1-Web-DataDomainService.svc/binary"
I'm not sure if the request been made to "ClientBin" means something, but i would like to point that out
Well, i'll keep trying and searching, because this is really frustrating and i need to make it work!
12/11/2009 6:44 AM | # re: Deploying your Silverlight and WCF RIA Services application
Tim...Great help...but
I have the "IIS specified authentication schemes 'IntegratedWindowsAuthentication, Anonymous" error, I am using a shared web hosting without access to IIs Directory Security setting. Is there any alternative to solve this in web.config ? (using endpoint,...)
12/11/2009 7:25 AM | # re: Deploying your Silverlight and WCF RIA Services application
Tim,
I'm curious about why RIA Services requires full trust. Do you know why? I thought full trust was not needed for serving up a Silverlight app, nor for exposing a WCF service. Is that right? Is it the DB access that requires the trust?
Thanks, as always, for your excellent explanations.
JJ
12/11/2009 9:05 AM | # re: Deploying your Silverlight and WCF RIA Services application
Tim, I did some more playing around and still am having the same issue. I created a brand new Silverlight Business Application and added a simple data grid. Works great on my machine but is getting the same error as before (404 on the svc call). I have another Silverlight application which uses the older method of data access (via a Service Reference) and it works great. One thing I noticed is that the .svc file shows XML for the classes. On the Ria Services application I am still getting the 404 error. Is there a handler we need to map to get this to work? Seems like it shouldn't be this hard to get it to work.

Thanks again!
12/11/2009 9:50 AM | # re: Deploying your Silverlight and WCF RIA Services application
Rajneesh -- great point on your post as well. You can also generate the actual SVC files too if that helps some folks deploy easier.
12/11/2009 9:57 AM | # re: Deploying your Silverlight and WCF RIA Services application
Chris R -- yes, there is a handler -- look in the web.config of your local application. There is an HttpModule that is there. You'll see the DomainServiceModule in there. Perhaps I need to add that above -- I will.
12/11/2009 1:56 PM | # re: Deploying your Silverlight and WCF RIA Services application
for erros like "IIS specified authentication schemes 'IntegratedWindowsAuthentication, Anonymous" error,and RIA on shared web hosting without access to IIs Directory Security settings..
Just Add
1.
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
<baseAddressPrefixFilters>
<add prefix="http://www.yoursite.com"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>

2.
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

to domainservice classes

3.
<services>
<service name="SparkExams.Web.AuthenticationService"
behaviorConfiguration="RIAServiceBehavior">
<endpoint address="" binding="wsHttpBinding"
contract="SparkExams.Web.AuthenticationService" />
<endpoint address="/soap"
binding="basicHttpBinding"
contract="SparkExams.Web.AuthenticationService" />
<endpoint address="/binary"
binding="customBinding"
bindingConfiguration="BinaryHttpBinding"
contract="SparkExams.Web.AuthenticationService" />
</service>

to each service (change namespace from SparkExams to yours)

4.
<behaviors>
<serviceBehaviors>
<behavior name="RIAServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="BinaryHttpBinding">
<binaryMessageEncoding />
<httpTransport />
</binding>
</customBinding>
</bindings>

Thats it .... it will work.. I have tested this on different hosting enviornments.

For further details visit : http://rajneeshnoonia.blogspot.com


12/12/2009 6:32 PM | # re: Deploying your Silverlight and WCF RIA Services application
This is the error I get through Fiddler and this is a 404 error. I verified the web.config for the httpModule to be exactly like what Tim mentioned. All help will be appreciated

[EndpointNotFoundException]: The service &#39;/ClientBin/PG.RIAServices.Web.GenDocDomain.svc&#39; does not exist.
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String
12/13/2009 3:38 AM | # re: Deploying your Silverlight and WCF RIA Services application
regarding the fiddler issue that IE is bypassing the local request like http://localhost. The trick with the dot dosnt work on Windows 7 with IE8. Workaround is
http://ipv4.fiddler:50842/WebSite3/Default.aspx
12/13/2009 11:43 AM | # re: Deploying your Silverlight and WCF RIA Services application
Tim - verified the handler was already there in httpModules. I followed the steps that Rajneesh outlined above and still no success. I found some documentation about setting in the system.webServer part of the web.config. Can you provide the correct settings for this?

Also, in IIS 7, can you confirm that the web site should be running in Integrated Mode vs. Classic Mode?

Thanks!

<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="DomainServiceModule" preCondition="managedHandler" type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
12/13/2009 4:35 PM | # re: Deploying your Silverlight and WCF RIA Services application
Hannes -- weird...the IP trick works for me on Win7/IE8
12/14/2009 6:41 AM | # re: Deploying your Silverlight and WCF RIA Services application
Hi, as many other people here I ahve been struggling with the 404 NOT FOUND error when requesting a WCF Ria Service.
The error does not occur on VS 2008 development environment but only when the application is deployed to a II7 web app.

I have followed all possible suggestions and nothing seems to work.
Any solution?
12/14/2009 2:45 PM | # re: Deploying your Silverlight and WCF RIA Services application
Out of curiosity... has anyone else been able to get WCF RIA to work using a Web Deployment Project? After 2 days of fruitless searching and consistenly getting a 404 where a service should have been, I used Publish instead of Deploy and presto... everything worked.

Any chance it's just a fluke on my dev box or is this really a gaping hole in the WCF RIA story?
12/15/2009 6:23 AM | # re: Deploying your Silverlight and WCF RIA Services application
I have followed every suggestion including Publish instead of Deploy and am still getting the 404 error. My projects were working fine using the July Preview of RIA Services.

Obviously this is a show stopper for us to continue to use Silverlight and Ria Services. Thoughts on how to proceed?
12/15/2009 10:31 AM | # re: Deploying your Silverlight and WCF RIA Services application
the lack of server side tools makes this problem very frustrating as I am run fine on my local IIS but when I deploy on a shared resource like my ISP I also get these 404 issues and I follow all the above advice but am running into the following message from Fiddler:

HTTP/1.1 500 System.ServiceModel.ServiceActivationException
of course there are no details as that would be too easy and I cannot run WCFTrace on my ISP. So I enter rhe svc URL into my browser and see:

The CLR Type 'WizardRIA.Web.DomainServiceHostFactoryEx' could not be loaded during service compilation. Verify that this type is either defined in a source file located in the application's \App_Code directory, contained in a compiled assembly located in the application's \bin directory, or present in an assembly installed in the Global Assembly Cache. Note that the type name is case-sensitive and that the directories such as \App_Code and \bin must be located in the application's root directory and cannot be nested in subdirectories

well this is real curious as I have a directory called services under my server side project (wizardria.web)
and the markup is
<%@ ServiceHost Service="WizardRIA.Web.GreenDomainService" CodeBehind="WizardRIA-Web-GreenDomainService.svc.cs" Factory=" WizardRIA.Web.DomainServiceHostFactoryEx" %>

and the code is
namespace WizardRIA.Web
{
public class DomainServiceHostFactoryEx : DomainServiceHostFactory
{

protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
{
return new DomainServiceHost(serviceType, baseAddresses[0]);
}

The code is found on my local IIS setup as I can but a breakpoint in here so why not on my ISP and it is part of the server Namespace and I think it should be in the XAP file that I deploy. Any pointers would be appreciate and hope that MS cleans this mess up soon as WCF Ria is great framework but not in its current state.


12/15/2009 10:35 AM | # re: Deploying your Silverlight and WCF RIA Services application
Chris, here are the things that I had to work through when I pushed this out to a production server last night after *finally* getting it working on a staging server. I doubt it's anything new for you but here goes:

1) Had to install the Hotfix (It's a Server 2003 box)
2) Had to remove the default "Integrated Windows Authentication" checkbox under Directory Security in IIS
3) Had to install RIA Services using the SERVER=TRUE trick that Tim mentions here
4) Had to make sure there was only one host header assigned to the web site
5) Had to double check my ASP.NET authentication settings using a plain old ASP.NET page (had a connection string error)
6) As noted, I had to Publish rather than Deploy my web site (as annoying as it is to have to do that)

Once I did all of these things (and I restarted the app pool) things fired up just fine on the production box.

My guess is that you have already done all of these things more than once but here's hoping that you get it working. Trust me, I know how frustrating this deploy thing is!

(FWIW, I am hoping the SL / WCF RIA teams understand how important a smooth deploy process is for SL adoption. A *big* part of our decision to go with SL instead of Flex was that we already had all the tools and processes in place for deploying ASP.NET applications. We didn't want to have the pain of having to shoehorn a different technology into our current process. This last week was almost a plug pulling moment for us and we are already heavily invested in SL / WCF RIA. I know it's beta but it's not a good thing when so many people are having this much trouble just deploying an app.)

12/16/2009 6:40 AM | # re: Deploying your Silverlight and WCF RIA Services application
Had same issue as you did chris... "msiexec /i RiaServices.msi SERVER=TRUE" solved it somehow.
12/16/2009 9:36 AM | # re: Deploying your Silverlight and WCF RIA Services application
ok I finally got mine to work as i noticed that I only got the "Endpoint missing" if I had the /binary on the end of my service url as in //my site/myservice.svc/binary as soon as I removed the binary then my calls started working.
My understanding is the binary is to use WCF Binary encoding on the channel so the calls should be more efficient. Is there something I have to ask my ISP to do let this work?
12/16/2009 9:56 AM | # re: Deploying your Silverlight and WCF RIA Services application
Same errors here. The server sets up just fine, but when we go to the SL4 website we can't manage to talk to the DB. We can see the DomainService.svc file but no data. We've been trying everything mentioned here, but aren't finding anything that works. It would be nice if there was some better documentation somewhere.

SL4, IIS7 .NET4 VS2010, ect.

Paul
12/16/2009 3:36 PM | # re: Deploying your Silverlight and WCF RIA Services application
Paul p ... exactly what errors are u getting when u run Fiddler?
12/17/2009 4:00 AM | # re: Deploying your Silverlight and WCF RIA Services application
Hi, I also had these annoying 404 errors. I've been trying almost everything to get things to work described in the posts here, yet nothing helped. Then suddenly I managed to get things working. What did I change? I tried all tricks including defining my own services as Rajneesh Noonia describes in his post. Nothing changed. What I forgot: Install the RIA services using the "msiexec /i RiaServices.msi SERVER=TRUE" trick. Nothing changed. Of course: I forgot to restart the IIS. So some hours later, my application suddenly started successfully. It might be something stupid and clear to everyone that of course the IIS should be restartet. Anyway when trying this and that and every kind of trick you forget the simplest things, therefore I post it here. I tried to replay that on another server, kicked out all the service definitions in the web.config before (e.g. did NOT follow Rajneesh Noonia's advice) and the thing still worked - after a server restart.

Cheers,

Stefan
12/17/2009 7:38 AM | # re: Deploying your Silverlight and WCF RIA Services application
We're having trouble talking to the .svc file. I'm kind of new at this, so I might be missing something obvious, but I'm learning a lot. I've done the SEVER=TRUE install and all those kinds of steps. I can actually get our content to show up on the page, but the first time we try to access the DB it fails. You guys have gotten me quite far even if you don't get me any further and for that I am very grateful. Thanks!

Fiddler Errors:

WCF Binary Received:
System.ServiceModel.CommunicationException: Unrecognized message version.
at System.ServiceModel.Channels.ReceivedMessage.ReadStartEnvelope(XmlDictionaryReader reader)
at System.ServiceModel.Channels.BufferedMessage..ctor(IBufferedMessageData messageData, RecycledMessageState recycledMessageState, Boolean[] understoodHeaders)
at System.ServiceModel.Channels.BinaryMessageEncoderFactory.BinaryMessageEncoder.ReadMessage(ArraySegment`1 buffer, BufferManager bufferManager, String contentType)
at System.ServiceModel.Channels.MessageEncoder.ReadMessage(ArraySegment`1 buffer, BufferManager bufferManager)
at BinaryMessageFiddlerExtension.BinaryInspector.GetWcfBinaryMessageAsText(Byte[] encodedMessage)
at BinaryMessageFiddlerExtension.BinaryInspector.UpdateView(Byte[] bytes)


RAW Received:
HTTP/1.1 404 Not Found
Cache-Control: private
Server: Microsoft-IIS/7.0
X-AspNet-Version: 4.0.21006
X-Powered-By: ASP.NET
Date: Thu, 17 Dec 2009 14:11:16 GMT
Content-Length: 0



Request Header:
POST /ClientBin/PPW-Web-PPWDomainService.svc/binary HTTP/1.1

Response Header:
HTTP/1.1 404 Not Found
12/17/2009 2:22 PM | # re: Deploying your Silverlight and WCF RIA Services application
Thanks to everyone for their input and advice. I finally got back to this and have mixed results to report. We have two servers, one II6 and one II7. I was able to get the application to work on the box with II6, but it still does not work on the II7 box. It is the same code, applied the hotfix, tried the SERVER=TRUE stuff, etc. I'm at a loss of what to try now. Has anyone gotten this to work on IIS7?
12/17/2009 3:00 PM | # re: Deploying your Silverlight and WCF RIA Services application
I was having the same 404 errors and added 'System.ServiceModel' to the References of the Web project and instantly began getting much more meaningful errors.

I followed Rajneesh Noonia's example and the site Administration Domain Service began to work but my custom domain service did not, it just returns a 404 error, which is really a 500 error (when I browse .svc 500 is reported in Fiddler).

Some-one from Microsoft RIA please give us a timeline for when a fix for these issues will be available...

12/19/2009 8:31 AM | # re: Deploying your Silverlight and WCF RIA Services application
As ITLackey said, not only for Windows Authentification:
"Set the enabled attribute on the profile element to false!
If you are using profiles the instead of setting this to false, the provider needs to be configured to use the proper database."
Many thanks to Tim and ITLackey
12/21/2009 12:35 PM | # re: Deploying your Silverlight and WCF RIA Services application
I have to say after reading most of this thread, it a string of excuses of a half baked product, yes I know it's beta.

My issue is that I NEED it deploy simply to a normal ASP.NET web app. I have to then make it work in SharePoint. It can be done, it always can. I saw great strides at the SP conference in LV. That was for SP 2010, what can we expect for 2007? We can upgrade when a prod version is available through our EA, however a lot of people don't have that luxery. It doesn't help that most can't get RIA Services deployed on a normal 2008/IIS7 Web Server.(Yes, read the doco, service packs, and hotfixes installed, checked all the web.config entries. Even tried a new R2 machine).

I can run it from my dev machine, which is EXACTLY the same as the test machine, even created off the same image.

A step by step from someone with success would elminate the confusion at this point.

I have seen a few less blasting entries from above ignored, I expect this one will either be denied, or ignored the same.
Gravatar
12/22/2009 2:19 PM | # re: Deploying your Silverlight and WCF RIA Services application
"And the server assemblies for RIA Services will be installed into the GAC for all to enjoy. The advantage this has is that it becomes easier to service if you have one set of assemblies to update versus a few /bin deployed applications scurried all over the place."

It should also be noted that another reason to do this is to reduce memory consumption if you have more than one site utilizing the libraries.

blogs.msdn.com/tess/archive/2006/04/13/575357.aspx

IIS and WCF are peculiar animals that sometimes hold on to old caches even when a restart of services occur. Problems my team have had always stems from mis configured bindings or the service references are not in sync between the client and server. Since RIA sits on top of WCF, those are good places to check if you're getting 404's stemming from an "Unrecognized message version" exception.
12/23/2009 7:58 AM | # re: Deploying your Silverlight and WCF RIA Services application
Chris R ,How you solve you problem at IIS 6 ,
The application Work at Windows server 2003 R2,but not Working at Windows server 2003 SP2 , and i face the same Problem as you was face .

could you advice me ?

Mahmoud Ahmed Arafa
12/24/2009 6:46 AM | # re: Deploying your Silverlight and WCF RIA Services application
I solve my problem (error 404) after I follow this link :

neilkilbride.blogspot.com/.../...4-for-aspnet.html

After that i have anther problem (Server Application Unavailable ) so I follow the below link :

weblogs.asp.net/.../436607.aspx

I hope that help

Mahmoud Ahmed Arafa
12/31/2009 12:47 AM | # re: Deploying your Silverlight and WCF RIA Services application
Hi Tim,
Thanks for the great post, it has cleared lot of stuff. I am still unable to get my app on the staging server (IIS 6 and Win 2k3). It gives me an error Failed to load the query "myQuery", Server returned error , not found. After doing the investigations with Fiddler I came to know that there is actual 500 error, Service activation error. I guess the service end point is missing. As there is no physical .svc file here. Everything depends on the baseprefixfilters element in web.config file. Let us say that my server name is server123 and the virtual directory name where this app is deployed is called vd123, so what value should i put in this element , should it be http://server123/vd123/" title="http://server123/vd123/">http://server123/vd123/ or http://server123/
Please advise
1/3/2010 9:14 PM | # re: Deploying your Silverlight and WCF RIA Services application
I was finally able to get my Silverlight applications working on our IIS 7 box. As it turned out the .NET Framework 3.0 Features for WCF Activation were not installed. I found this article which walked me through the steps.

stackoverflow.com/.../how-to-solve-a-http-error...

After the installation was complete my Silverlight apps are working as expected.

Hopefully this might others who are getting the 404 error on the .svc call.
1/5/2010 5:29 AM | # re: Deploying your Silverlight and WCF RIA Services application
Ciao Tim!

I am developing a Silverlight 3.0 application with WCF Ria Services.
I have done the deployment so as you. I have payed attention on the clientaccesspolicy file too.
So i have deployed my services to an IIS Application on a server (classic app pool, anonymus auth.). From the browser, I can open the service.

On my client (development) machine I have told my DomainContext to use the uri of my service.

SHRIAContext ctx = new SHRIAContext(new Uri(urlofservice));
(where RIAContext is my DomainContext)

If I run my application, I get the following exception:

Message:
Load operation failed for query 'GetCategory'. Exception has been thrown by the target of an invocation.

StackTrace:
at System.Web.DomainServices.ReflectionDomainServiceDescriptionProvider.ReflectionDomainOperationEntry.Invoke(DomainService domainService, Object[] parameters)
at System.Web.DomainServices.DomainOperationEntry.Invoke(DomainService domainService, Object[] parameters, Int32& totalCount)
at System.Web.DomainServices.DomainService.Query(QueryDescription queryDescription, IEnumerable`1& validationErrors, Int32& totalCount)
at System.Web.Ria.Services.QueryOperationBehavior`1.QueryOperationInvoker.InvokeCore(Object instance, Object[] inputs, Object[]& outputs)

Fiddler gives me positive feedback (finds service):

# Result Protocol Host URL Body Caching Content-Type Process Comments Custom
919 304 HTTP 192.168.11.154:8080 /clientaccesspolicy.xml 0 iexplore:5752
920 200 HTTP 192.168.11.154:8080 /SHServices/ClientBin/SH-Services-SHRIAService.svc/binary 1'006 no-cache Expires: -1 application/soap+msbin1 iexplore:5752

I tried to create a console application to reproduce this exception. I got the same exception there too.

If you have any hint for me that helps me, I owe you a beer. :)

Best regards,

Marton

P.S.:

If you need any additional information, give me a feedback. ;)


1/13/2010 7:02 AM | # re: Deploying your Silverlight and WCF RIA Services application
@Chris Rouw... thanks so much, that fixed my 404 problems as well.

For my situation, here's the story. Our server is Windows Server 2008 Standard running IIS7. My app is SL3 built using VS2008 and WCF RIA Beta. I bin-deployed the appropriate dlls as in the article. Got 404s.

Then ran the command (ServiceModelReg.exe) that Chris links to above (StackOverflow)... and everything works.

Thanks again Chris.
1/13/2010 4:18 PM | # re: Deploying your Silverlight and WCF RIA Services application
Dear Tim,

I have seen that you develop .NET RIA Services.
If you could help me out with some information it would be nice.

I have a RIA authentication service operating with a WebContext.
The default binding is SOAP/Binary.

In a Silverlight page I want to login with the following code:

LoginParameters lp = new LoginParameters(username,password);
LoginOperation loginOperation = WebContext.Current.Authentication.Login(lp, LoginOperation_Completed, null);

It works when deployed to IIS7 on a https site.
The problem is as soon as I set the server to SSL required, I get an exception like a System.ServiceModel.ActivationException, in Fiddler the result 500.

As there is no explicit svc file, what can I do to change the endpoint to work with SSL?

A normal WCF service I've written in the same project works with these settings but I can't access the configuration of the RIA service at the moment. How can I do this?

<bindings>
<basicHttpBinding>
<binding name="AuthServiceBinding" allowCookies="true">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<behaviors>
<serviceBehaviors>
<behavior name="AuthServiceBehavior">
<serviceDebug httpsHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
<serviceCredentials>
<serviceCertificate findValue="CardSpace" x509FindType="FindBySubjectName" />
<userNameAuthentication userNamePasswordValidationMode="Windows" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="AuthServiceBehavior" name="AuthorizationServiceImpl">
<endpoint binding="basicHttpBinding" bindingConfiguration="AuthServiceBinding"
name="httpEndpoint" contract="IAuthorizationService" />
</service>
</services>


1/13/2010 5:59 PM | # re: Deploying your Silverlight and WCF RIA Services application
For people who get this message:

System.ServiceModel.CommunicationException: Unrecognized message version.
at System.ServiceModel.Channels.ReceivedMessage.ReadStartEnvelope(XmlDictionaryReader reader)
at System.ServiceModel.Channels.BufferedMessage..ctor(IBufferedMessageData messageData, RecycledMessageState recycledMessageState, Boolean[] understoodHeaders)
at System.ServiceModel.Channels.BinaryMessageEncoderFactory.BinaryMessageEncoder.ReadMessage(ArraySegment`1 buffer, BufferManager bufferManager, String contentType)
at System.ServiceModel.Channels.MessageEncoder.ReadMessage(ArraySegment`1 buffer, BufferManager bufferManager)
at BinaryMessageFiddlerExtension.BinaryInspector.GetWcfBinaryMessageAsText(Byte[] encodedMessage)
at BinaryMessageFiddlerExtension.BinaryInspector.UpdateView(Byte[] bytes)


That message is coming from the Fiddler extension "BinaryMessageFiddlerExtension" and not from the web server itself.
(Just so you don't spend too much time, like I did, trying to track down that more detailed message...)

1/27/2010 3:27 PM | # re: Deploying your Silverlight and WCF RIA Services application
Dear Tim,

Thank you for your useful post. But I get the following error every time I try to run my Silverlight Business Application:

"The Silverlight project you are about to debug uses RIA services.RIA services fail unless the Silverlight project is hosted in and launched from the same web project that contains the RIA services."

And it’s so interesting because to fix this error , I just need to make a change( any sort of changes like creating a blank line in the source of Web Project !!!!)
And after that it will be compiled and executable as well.

Thanks,
Azadeh
Gravatar
1/29/2010 5:21 PM | # re: Deploying your Silverlight and WCF RIA Services application
Tim, or anyone else, I desperately need help on this. I have created a dummy site with WCF Ria Services at cn2.cellnique.com and it is working flawlessly. However, on the official site, things do not work. Can someone point me to the right direction? The official site is happysad.blivskin.com
I have tried all possible solutions mentioned but to no avail. I seriously hate issues like this. It took me such a long time to develop and when it's done, it's not working.
2/1/2010 8:26 AM | # re: Deploying your Silverlight and WCF RIA Services application
Hi! Same story...
Upgraded my project to WCF Ria Services Beta (VS2008).
Made everything work (some rewrite from July CTP). Works 100% in VS/debug mode.
Publish to 2003/IIS6. NOT working. My project contains another WCF service, which is working 100%. My solution is running exclusively on server (ho host headers, default site, port 80))
Tried everything suggested by numerous bloggers, including this blog.
We desperately need to know exactly what is required to get it to work when deployed! I regret the upgrade now, as eveything was actually working with the July Preview, except for some bugs I had found workarounds for...
2/2/2010 8:21 AM | # re: Deploying your Silverlight and WCF RIA Services application
Hi Everyone,

Just want to share my experience on this DXX RIA Deployment issue.

My project works ok in my development machine and fail once deployed (petty standard developer story ...). My Server is window server 2003 and IIS6. It took me a while to find out what I was missed and land on this site at last.

So basically what Tim mentioned above is very useful but I found that a little bit more information will make this post better.

First if you are running IIS6 like me please add .xap in the server mine type, (Extension: .xap, MINE type: application/x-silverlight-app). If you a one of the lucky one running IIS7, don't worry, it should be setup already.

Second, Bin Deploy followings System.ComponentModel.DataAnnotations, System.Web.DomainServices, System.Web.Ria. I found that without System.ComponentModel.DataAnnotations, the SL app. runs but can not connect to the database and will get error like getDataTable not found

I hope this 2 cents help.

Edwin
2/3/2010 1:56 PM | # re: Deploying your Silverlight and WCF RIA Services application
Hi!
An update on my progress: Solved!
Here is what I did:
My original VS solution was a "web site" one, where Silverlight and WCF RIA Services was introduced later. WCF RIA Services was introduced through a WCF RIA Services library. After having tried everything I found about this issue and failed, I took some drastic decision: What happens if I create a new "web application" solution and move all code over (95% copy & paste)?
Answer: Works 100% without any issues when deployed to 2003/IIS6.
This time I only needed Tim's list of tips above, nothing else...
Hope this can help others!


2/3/2010 9:26 PM | # re: Deploying your Silverlight and WCF RIA Services application
how to deploy (vs2010,ria service,windows7,iis7.5,sqlserver2008).we realy need help,thanks
2/8/2010 2:29 PM | # re: Deploying your Silverlight and WCF RIA Services application
I had this problem and I finally got it fixed by doing two things

1) Making sure the DataAnnotations dll was deployed
2) Removed any additional Host Header (or binding in IIS7) to my site, as I had it set to do both www.mysite.com and mysite.com. I got rid of the mysite.com and it worked perfectly!
2/10/2010 10:00 AM | # re: Deploying your Silverlight and WCF RIA Services application
I had the 404 issue for the services as well. In my case, this was on Windows Server 2009/IIS 7.0.

The solution for me was to this:

Control Panel > Administrative Tools > Server Manager > Features > Add Features > .NET Framework 3.0 Features > WCF Activation

Make sure WCF Activation and all children are turned on.
2/16/2010 7:26 PM | # re: Deploying your Silverlight and WCF RIA Services application
When i try to go directly to my .svc i get the following error:

The HttpGetEnabled property of ServiceMetadataBehavior is set to true and the HttpGetUrl property is a relative address, but there is no http base address. Either supply an http base address or set HttpGetUrl to an absolute address.

any suggestions?
2/16/2010 7:59 PM | # re: Deploying your Silverlight and WCF RIA Services application
Chris Rouw - Thank you so much! After hours and hours of reading, I finally found to activate WCF from your post. I had actually thought this might be the problem hours ago, and searched for a "WCF Server Download Install", thinking I did not have WCF installed on Server 2008. I discovered it was a part of the core .Net 3.5, and assumed it was installed and working. It was installed, just not activated.

BOOOOOO Microsoft. Get your act together. Absolute horible wasted of my time. Extremely frustrating. Build an template BusinessApp on VS 2008, change not a single line of code, upload it to Server 2008/ IIS 7 and it fails to run. Then spend hours pulling out my hair.
2/17/2010 7:25 AM | # re: Deploying your Silverlight and WCF RIA Services application
strange, for my issue actually removing <baseAddressPrefixFilters> helped. I needed it when i had two domain pointers to one website, now that i only have one i had to remove it.
2/26/2010 12:03 AM | # re: Deploying your Silverlight and WCF RIA Services application
I think it's worth while to mention to adapt the connectionsstring to the entities in the web.config file.
After deployment you have to change the db-connection to the desired Sql Server.

In my case I got an error "The underlying provider failed on Open". Fitting the connectionstring solved this problem.
3/10/2010 5:15 AM | # re: Deploying your Silverlight and WCF RIA Services application
I've got most of it to work. except when im using fiddler i see it tries to acces the service it says endpoint not found. When i remove the /binary%20HTTP/1.1 part i can see the service is working. Is there any way to solve this? can i put an endpoint adresses in the web.config or is there a way not to start the htpp 1.1 protocol and just use the service without the binary%20http/1.1?

any suggestions anyone?

3/16/2010 7:56 AM | # re: Deploying your Silverlight and WCF RIA Services application
Chris Rouw.Follow your method and WCF RIA SERVICE have worked on IIS7.
3/18/2010 6:56 PM | # Moving Auth service into separate assembly
Hi,
I am moving all my services including the standard AuthenticationService and UserReg service (this is the RC, VS 2010, SL 4) into a separate assembly on the server. When I do that, the WCF service calls return Not Found. The generated code is generating a call to TRM-Services-UserRegistrationService.svc, where TRM.Services is the DLL that hosts it. The WCF app message log shows Endpoint Not Found...any tips?
3/18/2010 8:07 PM | # re: Deploying your Silverlight and WCF RIA Services application
John - take a look at the traffic (via Fiddler) and see what is going on in actual exceptions/communication to get more detail.
3/25/2010 1:35 PM | # re: Deploying your Silverlight and WCF RIA Services application
Great article. Kind of confusing though since I am new to RIA Services. I have moved the Domaine Service Classes from my web project to a seperate RIA Domain Service Class Library Project. That Assembly is referenced in the Web Project, and when I test the whole thing Dev Web Server it works fine. When publshing the website, the silverlight part works fine, but it no data is collected from the DB, as if the "Back-End" part of the application is not hoocked up. Given my project structure, can you give me some info on what I need to deploy, and configure the web.config file.

Thx
3/25/2010 9:39 PM | # re: Deploying your Silverlight and WCF RIA Services application
Folsk looking for help deploying using the RIA Services RC bits please refer to the blog post here -
blogs.msdn.com/.../...-application-deployment.aspx
3/26/2010 11:21 AM | # re: Deploying your Silverlight and WCF RIA Services application
Thanks Saurabh. The link below addresses deployment of .Net 4 VS 2010 and SL 4. I am working with .Net3.5 VS 2008 and SL3. The issue that I am facing is related to the way I have my project layed out. If I move my DomainServices classes to the Web app then things work fine. However, It is does not work if the DomaineServices are in their own RIA Services Class Library.
3/30/2010 11:14 PM | # re: Deploying your Silverlight and WCF RIA Services application
Whew... I think I read every post here and tried every method and still getting a 404.

I'm thinking about just using JSON and javascript to make this work after spending so many hours trying to get the deployment to work.
Gravatar
4/6/2010 8:11 AM | # re: Deploying your Silverlight and WCF RIA Services application
I have solution with 2 projects: Web and Silverlight. I am using ADO.NET Entity Data model. Everything works fine when I run from VS using local server. Then I publish project to our IIS. When I open page with Silverlight, I see controls, but I don't see any data coming and no errors. Aspx pages work fine, it's only Silverlight. I tried to install RIA using msiexec /i RiaServices.msi SERVER=TRUE
but it gives me error that VS and all tools are missing. I added serviceModel to web.config. Nothing.. Really need help.
Thanks



4/7/2010 3:01 AM | # re: Deploying your Silverlight and WCF RIA Services application
Awesome, THANK YOU!
4/7/2010 12:31 PM | # re: Deploying your Silverlight and WCF RIA Services application
I fought the deployment for 2 days, I was getting a 404 not found too...
what it turned out to be (at least for me) was using publish in VS2008. If I copied the files manually everything works. Could someone please explain why?

5/4/2010 2:48 PM | # re: Deploying your Silverlight and WCF RIA Services application
My problem of ServiceActivationException was because the Authrntication on my site had both Anonymous and windows enabled. I disabled windows authentication and it worked like a charm.
5/10/2010 11:31 PM | # re: Deploying your Silverlight and WCF RIA Services application
This is a great website. It is worth it.
5/20/2010 1:09 PM | # re: Deploying your Silverlight and WCF RIA Services application
I really had a problem deploying a small Silverlight app that I've developed using RIA Services to our production server. Our production server environment is as follows:

Windows Server 2008
IIS 6.0

.NET 4 Framework is already installed, and the site was configured for the this version. We have installed RIA Service on our server using msiexec /i RIAServices.msi /SERVER=true. The site is configured to run as Anonymous Access.

When the application starts the following error appears in its own Silverlight window:

Load operation failed for query 'GetBlogs'. The remote server returned an error: NotFound.

at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.LoadOperation.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)
at System.ServiceModel.DomainServices.Client.DomainContext.<>c__DisplayClass1b.<Load>b__17(Object )

When trying to access the generated .SVC on the production server using the following address:

Ourserver/.../WeeklyBlog-Web-WeeklyBlogService.svc , we get
HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)

Resolved the problem by doing the following:

The problem was with the Application Extension Mapping settings on our IIS 6.0 Server. For the .SVC extension it was set for "Check that file exists". Un-checking this box corrected the problem, I was able to connect to the WCF RIA Service via Ourserver/.../WeeklyBlog-Web-WeeklyBlogService.svc

Hope this will help to others having the same issue.
5/23/2010 4:07 PM | # re: Deploying your Silverlight and WCF RIA Services application
Аркадий, подскажите, как можно применить описанный вами способ для IIS 7? Заранее благодарен.
6/9/2010 12:00 PM | # re: Deploying your Silverlight and WCF RIA Services application
I'm having an issue that none of these suggestions seem to fix. I have a Silverlight 4, .Net 4, and WCF RIA Services 1 application running fine on my Windows 7 + Visual Studio 2010 development machine but when publishing to a test server it is not working. The server is 2008 server + IIS 7. I have tried installing the RIA DLLs onto the server but still does't help. I think it might be an IIS configuration issue, but I'm not sure. Here is there error I am getting:

System.TypeInitializationException: [TypeInitialization_Type]
Arguments: Balenz.Web.UI.Controllers.ApplicationController
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See go.microsoft.com/.../ ---> System.InvalidOperationException: The current application or application host is null and the host Uri cannot be determined.
at System.ServiceModel.DomainServices.Client.WebDomainClient`1.ComposeAbsoluteServiceUri()
at System.ServiceModel.DomainServices.Client.WebDomainClient`1..ctor(Uri serviceUri, Boolean usesHttps, ChannelFactory`1 channelFactory)
at Balenz.Web.Services.LicenseContext..ctor()
at Balenz.Web.UI.Controllers.ApplicationController..ctor()
at Balenz.Web.UI.Controllers.ApplicationController..cctor()
--- End of inner exception stack trace ---
at Balenz.Web.UI.Controllers.ApplicationController.get_Instance()
at Balenz.Web.UI.App..ctor()

Thanks,
Chris
7/15/2010 8:58 AM | # re: Deploying your Silverlight and WCF RIA Services application
tim,

After I finished working with your RIA Services Walkthrough on Business application, I tried to do the steps on your deployment but still getting the error message "An error occurred while loading data through 'GetEmployees' query on DomainContext of type AdvDomainContext..."

I'm using WindowsXP SP3, IIS 5.1, VS2008 SP1, WCF Ria Services Toolkit 4.0, Silverlight 3.

Is it possible to deploy it in IIS 5.1?

I appreciate your help.

Thank you.

Donz
7/20/2010 11:25 PM | # re: Deploying your Silverlight and WCF RIA Services application
aspnet_regiis.exe -i in VS 2010 command prompt.

fix my problem
Gravatar
9/15/2010 7:58 AM | # re: Deploying your Silverlight and WCF RIA Services application
Folks please help.
I am using VS2010 and .NET framework 4 for my SL app and cannot see:
System.Web.DomainServices nor System.Web.Ria in my list of references to add.

Are they renamed?
thanks.
10/4/2010 4:09 AM | # re: Deploying your Silverlight and WCF RIA Services application
Very very thanks for this article.It is ver helpful
10/14/2010 8:09 AM | # re: Deploying your Silverlight and WCF RIA Services application
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.
10/30/2010 5:53 AM | # re: Deploying your Silverlight and WCF RIA Services application
Thank you very much,It was helped me a great favor.
11/8/2010 7:35 PM | # re: Deploying your Silverlight and WCF RIA Services application
is there a place you can point me to for hosting a silverlight business app on godaddy. I think (thought) I had it figured out. I was getting a similar error at my house that I was getting on GoDaddy.

I removed the reference to Integrated Windows Authentication in MY IIS and the site worked fine. GoDaddy, however, makes it a bit more difficult to change this setting. After a 48 minute conversation, I wass able to convince them it modify IIS on their end to remove the IWA reference.

I am not getting the same message I was getting from fiddler though. My fear is that 24-72 hours from now I am still going to be in the same boat. I am getting a 500 error on fiddler from godaddy with very little detail. My LOCAL error was 500 also. It was giving me grief about Integrated Windows Authentication, blah, blah, blah...You're a smart guy...i'm sure you see where I am going...

Is it just not possible to host a WCF/RIA service on GoDaddy? Even the basic GetUser funtion embedded into the base SL Business App fails...It seems all services are not found... Am I missing something???
11/8/2010 9:43 PM | # Deploying your Silverlight and WCF RIA Services application
i have this error.. :S someone can tell somethink about that.. :S

Error de configuración
Descripción: Error durante el procesamiento de un archivo de configuración requerido para dar servicio a esta solicitud. Revise los detalles de error específicos siguientes y modifique el archivo de configuración en consecuencia.

Mensaje de error del analizador: No se puede cargar el archivo o ensamblado 'System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' ni una de sus dependencias. El sistema no puede hallar el archivo especificado. (C:\Inetpub\wwwroot\SICAM\web.config line 15)

Error de código fuente:

Línea 13: <system.web>
Línea 14: <httpModules>
Línea 15: <add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
Línea 16: </httpModules>
Línea 17: <compilation debug="true" targetFramework="4.0">


Archivo de origen: C:\Inetpub\wwwroot\SICAM\web.config Línea: 15
3/21/2011 8:58 AM | # re: Deploying your Silverlight and WCF RIA Services application
Hey I am so happy I found your web site, I really found you by mistake, while I was browsing on Aol for something else, Anyways I am here now and would just like to say many thanks for a fantastic post and a all round interesting blog how to overcome depression
4/8/2011 6:29 AM | # re: Deploying your Silverlight and WCF RIA Services application
Nice post!
I'm using domaindatasource to bind my classes (from a RIA service) to a datagrid.
I want the show the user total number of rows that is returning from my DomainService. To solve this I'm using "TotalEntityCount" after the data have been loaded into my domainDataSource.
My problem is that the TotalEntityCount keeps returning "-1" after I have published the application. On my local computer it is returning the correct number.
Could this have something to do with the Deployment...?

Here is the forum thread: http://forums.silverlight.net/forums/t/224853.aspx


Marius.
4/19/2011 11:43 PM | # re: Deploying your Silverlight and WCF RIA Services application
When WCF RIA Services comes out of beta/ctp status and releases next year, the development story will be that of Silverlight 4 and .NET 4 on the server. k visit ad visit am visit u visit
6/26/2011 1:12 PM | # re: Deploying your Silverlight and WCF RIA Services application
http://refactorthis.wordpress.com/tag/iis6/

My scenario, deploying to a virtual directory on IIS. I was getting a 404 for the dynamically generated .svc. Following the posting on this page I added .svc to my virtual directory with "Verify File Exists" unchecked and my days of aggrevation and searching have now come to an end. Hopefully that will aid you as well.
8/12/2011 11:24 PM | # re: Deploying your Silverlight and WCF RIA Services application
I had the 404 issue as well, and fixed it by re-registering IIS with .NET 4:

C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -i

Prior to this, I was missing any ".svc" handler and manually added it to web.config (svc-Integrated-4.0) via this article below:

stackoverflow.com/.../404-when-running-net-4-wc...

While this is NOT necessary, it did help troubleshoot. I immediately received an invalid module error which led me to the aspnet_regiis.exe -i fix. Then the 404 error went away, I could browse my .SVC file, and I removed the web.config line (no longer needed it, only for troubleshooting) (svc-Integrated-4.0).
Gravatar
11/1/2011 4:25 AM | # re: Deploying your Silverlight and WCF RIA Services application
Another thing to check when you are getting 404 errors calling WCF RIA Services is that the version of ASP.Net is correct. Had this recently where three out of four deployments were working. The one that wasn't had the wrong ASP.Net version. Worked as soon as that was changed and application pool recycled.
11/6/2012 5:54 AM | # re: Deploying your Silverlight and WCF RIA Services application
Hi, It's Great Article,

I am reciving new error msg which was not addresed in your article.

Error Msg
----------
Load operation failed for query 'GetUser'. The remote server returned an error: NotFound.

at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.End(IAsyncResult result)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.<>c__DisplayClass1.<HandleAsyncCompleted>b__0(Object state)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.RunInSynchronizationContext(SendOrPostCallback callback, Object state)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.HandleAsyncCompleted(IAsyncResult asyncResult)
at System.ServiceModel.DomainServices.Client.AsyncResultBase.Complete()
at System.ServiceModel.DomainServices.Client.ApplicationServices.WebAuthenticationService.HandleOperationComplete(OperationBase operation)
at System.ServiceModel.DomainServices.Client.LoadOperation.<>c__DisplayClass4`1.<Create>b__0(LoadOperation`1 arg)
at System.ServiceModel.DomainServices.Client.LoadOperation`1.InvokeCompleteAction()
at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.LoadOperation.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)
at System.ServiceModel.DomainServices.Client.DomainContext.<>c__DisplayClass1b.<Load>b__17(Object )
-----
Our Application built on ASP.NET + Silverlight 5 + RIA + EF , VS2010 SP1
hosted on Shared Hosting with IIS 6

regards
Djoy



7/9/2014 1:22 AM | # re: Deploying your Silverlight and WCF RIA Services application
Hi,

We have deployed our silverlight application machine on server. if user is opening the application first time, it will give error that "load operation failed for query 'GetXXXXXX.........'. It is unable to open the DB connection but now if user will refresh the page. It will work properly.

any suggestion is it a code issue, or some IIS setting.

Regards,
~Meha

 
Please add 4 and 2 and type the answer here:

DISCLAIMER:

The opinions/content expressed on this blog are provided "ASIS" with no warranties and are my own personal opinions/content (unless otherwise noted) and do not represent my employer's view in any way.