Could not load file or assembly 'System.ServiceModel.Web, Version='

Could not load file or assembly 'System.ServiceModel.Web, Version=' or one of its dependencies. The system cannot find the file specified.

I am new with visual studio 2013 and I am trying to make wcf data service with .edmx but I could not made my wcf data service due to above error.

Myservice.svc File in visual studio 2013

<%@ ServiceHost Language="C#" Factory="System.ServiceModel.Activation.WebServiceHostFactory, System.ServiceModel.Web, Version=" Service="_4669.MyService" %>

Myservice.svc File in visual studio 2010

This one is working fine.

<%@ ServiceHost Language="C#" Factory="System.Data.Services.DataServiceHostFactory, System.Data.Services, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" Service="LoanCalculatorService.srvcLoanCalculator" %>


<?xml version="1.0" encoding="utf-8"?>
  For more information on how to configure your ASP.NET application, please visit
    <!-- For more information on Entity Framework configuration, visit -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <compilation debug="true" targetFramework="4.5">
        <add assembly="System.Data.Entity, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Security, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Data.Entity.Design, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <add extension=".edmx" type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider" />
    <httpRuntime targetFramework="4.5" />
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <add name="SupportDBEntities" connectionString="metadata=res://*/App_Code.Model.csdl|res://*/App_Code.Model.ssdl|res://*/App_Code.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=GOVINDA;initial catalog=SupportTicket;persist security info=True;user id=sa;password=sa_12345;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
        <parameter value="v11.0" />


In my case when I make wcf data service in visual studio 2010 then it working and when i make in visual studio 2013 then it is not working in my case.

if someone have any idea about it then please help me.

Thanks in advance !..


I found that none of the above solutions worked for me on a newly built Windows 2012R2 server. I had 3.5 and 4.5 installed as both Frameworks and ASP.NET Features. Recompiling my application as Full rather than Client made no difference. Then I tried browsing to the Default Web Site and when that gave the same error I started to think something fundamental was wrong.

The solution I found was to edit the web.config in both C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config and C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config

(assuming that you may use either 32 or 64 bit application pools)

and simply comment out the reference to System.ServiceModel.Web ie:


<add assembly="System.ServiceModel.Web, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


<!--add assembly="System.ServiceModel.Web, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/-->

The Default Web Site then loaded correctly and so did my own ASP.NET system

Try adding this to your assembly list:

<add assembly="System.ServiceModel.Web, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

Also if you don't have .NET 4.0, get it here:

I encountered such a situation in following circumstances: Windows Server 2012 R2 hosts in IIS 2 web applications: one compiles against .NET 3.5 another - to .NET 4.5.1. Both are running in Intergrated pipeline Server have installed .NET 3.5/4.0/4.5/4.5.1 with latest updates. Issue was encountered in application on .NET 3.5. Fix was to update web.config transform with

  <remove name="svc-Integrated-4.0" xdt:Transform="Insert" />

As far as I understand, System.ServiceModel.Web, Version= could not be loaded in application pool running against ASP.NET 2.0 (for apps, compiled against .NET 3.5), while svc-Integrated-4.0 handler tries to load it.

Need Your Help

How to make ssh connection in workflow through groovy script by using sand box in Jenkins?

groovy jenkins jenkins-cli groovyshell jenkins-workflow

How to make ssh connection in workflow through groovy script by using sand box in Jenkins?

How to add multiple headers to Windows Phone WebBrowser?

c# windows-phone-7 windows-phone-8 windows-phone webbrowser-control

How do you add headers to the Windows Phone web browser control? I want to add two headers, fore and back. Right now I add one header by using this: