kamagra how much to take

InvalidOperationException With WCF Service In SharePoint 2010

At a client today we were focusing on moving a bunch of custom, in-house deliverables to a SP 2010 RC environment so that we could test all the moving pieces required for their environment to function. About half way through all successful, uneventful testing, we finally hit an error when examining a WCF service hosted in SharePoint. The particular error message was:

[InvalidOperationException: Operation is not valid due to the current state of the object.] Microsoft.SharePoint.ApplicationRuntime.SPLayoutsMappedFile.MapLayoutsVirtualPath(String virtualPath)

If you run into this error, its pretty easy to fix. In the ServiceBehaviorAttribute of your service class, ensure the following is present:

  1. [AspNetCompatibilityRequirements(RequirementsMode=AspNetCompatibilityRequirementsMode.Allowed)]

As well in the SharePoint web.config, in the serviceHostingEnvironment make sure the aspNetCompatibilityEnabled attribute is set to true.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>