Because in website i retrieve from .svc
The type 'TaskService', provided as the Service attribute value in the ServiceHost directive could not be found.
and not in web application
[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class TaskService { [OperationContract] public List GetTasks(int id, int type) { List nodes = new List();
return nodes;
}
}
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="TaskServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<service behaviorConfiguration="TaskServiceBehavior" name="TaskService">
<endpoint address="" binding="basicHttpBinding" contract="TaskService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>