how to fix event log message saying " The service '/_vti_bin/client.svc' cannot be activated due to an exception during compilation" when using sharepoint 2016

Greg Booth 1,371 Reputation points
2023-04-12T18:02:10.4533333+00:00
Since upgrading to sharepoint 2016, we are seeing errors in the event log as per below.
What is causing these, and how do i resolve ?


WebHost failed to process a request.
 Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/18651332
 Exception: System.ServiceModel.ServiceActivationException: The service '/_vti_bin/client.svc' cannot be activated due to an exception during compilation.  The exception message is: The Web application at http://servername:1234/_api/Microsoft.SharePoint.Portal.SuiteNavData.GetSuiteNavData?v=2&Locale=en-US could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.. ---> Microsoft.SharePoint.SPException: The Web application at http://servername:1234/_api/Microsoft.SharePoint.Portal.SuiteNavData.GetSuiteNavData?v=2&Locale=en-US could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.
   at Microsoft.SharePoint.Utilities.SPUtility.ConfigServiceHostIfClaimsAuth(ServiceHost serviceHost)
   at Microsoft.SharePoint.Client.SPClientServiceHost.OnServiceHostOpening(ServiceHost serviceHost)
   at Microsoft.SharePoint.Client.Services.MultipleBaseAddressWebServiceHost.OnOpening()
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
   --- End of inner exception stack trace ---
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
 Process Name: w3wp
 Process ID: 7736


Microsoft 365 and Office | SharePoint Server | For business
{count} vote

2 answers

Sort by: Most helpful
  1. AllenXu-MSFT 24,941 Reputation points Moderator
    2023-05-04T05:39:55.0766667+00:00

    Hi @Greg Booth,

    As per the error message, I'm going to confirm with you:

    • Can you access the web application correctly?
    • Make sure the alternate access mapping is correctly set. Go to CA >> Manage service applications >> Configure alternate access mappings.

    User's image

    • The URL seems to be called by API, is there any custom code in your farm calling this? Does the code work normally?

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Benjamin Freitag 101 Reputation points
    2025-03-28T09:15:28.7933333+00:00

    Had the same error on a new SharePoint Server Subscription Edition. It was caused by the Site-URL not matching the URL of the Web-Application. I fixed it with this PowerShell Script:

    $site = Get-SPSite "https://server-name"
    $site.Rename("https://site.contoso.com")
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.