Inside of Visual Studio my Silverlight Business Application works fine. But when I publish it to my local machine's IIS (version 6.1), it runs fine, but doesn't seem to be able to access the RIA services. The first error to pop up is:
The application otherwise works fine. It navigates fine. That is, until it tries to access data from the server through RIA servi开发者_开发百科ces. I get messages like:
I know very little about deploying web applications, let alone silverlight applications with RIA services. I published using the following settings:
Edit:
I've used fiddler to get the exact error after realizing that the "NotFound" exception could be anything. It is as follows.
Server Error in '/PPCa' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /PPCa/login.aspx
I don't have a login.aspx page. Is this something internal to Silverlight? Do I need to create such a page?
On Windows 7 you will be using IIS7.
In Internet Information Services Manager application (found in administrative tools) click the top most node in the left hand pane which will look something like MACHINENAME (MACHINENAME\yourUsername). In the list of features double click the ISAPI and CGI Restrictions and ensure that the ASP.NET versions shown are allowed and not denied.
To prove that WCF has been registered with IIS check in the list of features for the Modules icon, double click it and look through the list for ServiceModel-4.0.
The web.config of your web project that hosts your Silverlight XAP should look like this (plus extras like your DB connection strings etc):
<?xml version="1.0"?>
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="DomainServiceModule" preCondition="managedHandler"
type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</modules>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpModules>
<add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</httpModules>
</system.web>
</configuration>
You might wanna take a look at this:
- How to delpoy RIA services and this
- SL and RIA issue
精彩评论