0
votes

Trying to run an MVC5 app on IIS 7.5 2008-R2 server gives the following error:

Could not load file or assembly 'System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

I don't know why this happens. I'm definitely not using RIA, the app is entirely pure MVC 5 and the exactly same app runs OK on another server (IIS 7.5 W 2012 R2 ). I use to have a Silverlight project on this server (2008 R2), but it has been removed long time ago.

I've compared the IIS settings on both servers and they are the same. I've reinstalled the same ASP.Net framework v 4.5.1 I've even installed RIA on the server, but nothing seems to remove this error.

I've also looked at several threads on SO and the Internet related to this topic and tried some of them, but at no results.

At this point and time, I have no idea on what else to do.

1

1 Answers

0
votes

You should remove any Web.config section that contains this

<system.web>
  <httpModules>
    <add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </httpModules>
  <compilation targetFramework="4.0" />
</system.web>

or this

<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>
</system.webServer>

see Guide to deploying RIA services