System.IO.FileLoadException for System.ServiceModel.dll in SharePoint 2013

I came across an interesting situation recently when doing a fresh installation of SharePoint 2013 where once the installation was done no one could access the site – instead there was a tonne of errors in the ULS logs with the below exception:

The given assembly name or codebase, ‘C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll’, was invalid.

Continue reading “System.IO.FileLoadException for System.ServiceModel.dll in SharePoint 2013”