Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

A namespace cannot directly contain members such as fields or methods while creating a WCF REST service in SP 2013 using VS 2013

$
0
0

Am creating a service layer using the wcf rest service in sp 2013 using vs 2013.

Referring the link :

SharePoint 2013: Create a Custom WCF REST Service Hosted in SharePoint and Deployed in a WSP

https://social.technet.microsoft.com/wiki/contents/articles/24194.sharepoint-2013-create-a-custom-wcf-rest-service-hosted-in-sharepoint-and-deployed-in-a-wsp.aspx

using Microsoft.SharePoint.Client.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Activation;
using System.ServiceModel;
using System.ServiceModel.Web;
using VGIL.Services.NPDServiceLayer.Model;


namespace VGIL.Services.NPDServiceLayer.ISAPI
{

AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]

}

AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]

but am getting error at above line. I have added the entry :

        

<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />

but, it stll throws the error.



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>