问题
Trying to migrate an existing working Silverlight application with WCF RIA services from IIS 6.0 to IIS 10.0 on Windows Server 2016 but the application fails returning 404 errors. When I install Visual Studio on the server and try running the application then it works fine within the context of IIS Express.
The server has the following components installed.
- Microsoft Silverlight 5.0
- Microsoft Silverlight 4 SDK
- Microsoft Silverlight 5 SDK
- WCF RIA Services V1.0 SP2
I’ve even tried to directly access the virtual RIA services created by the System.ServiceModel.DomainServices
and it results in 404 errors as well. The below is the screen print from fiddler when directly browsing from IIS. What am I missing here? Has anyone successfully deployed Silverlight with RIA services on IIS 10.0 ?
Per the comments, attached is the actual error when accessing the URL from the browser and the web.config settings
Appreciate your help on this.
回答1:
After long struggle figured out that we may need to enable HTTP Activation
for the WCF Services
under Add Roles and Features Wizard
as shown in the image. The 404 error thrown by WCF RIA services is really vague and may not give you the actual error even in tools like Fiddler.
Please note, I'm using Windows Server 2016, you may see a bit different wizard depending on the server version you're using.
回答2:
Dennis' answer worked for me. For anyone that would like to use Powershell to perform the installation, this is the command that I used.
Enable-WindowsOptionalFeature -Online -FeatureName WCF-HTTP-Activation45 -All;
Note that my first attempt failed because there were parent features which were missing. The -All
switch ensured that they were installed too.
来源:https://stackoverflow.com/questions/46917148/silverlight-with-ria-services-on-iis-10-0-results-in-404-error